From chapter 4 of text book
Problem 1:
/etc/passwd0
/./etc/passwd
/././etc/passwd
/etc/../etc/../etc/passwd and so on
Problem 2:
If you want to read the file again, just use random access operation and access byte 0. Therefore, Answer is NO
Problem 3:
If process is killed or crashes, the os can decide which files to close.
Problem 4:
RENAME does not change creation time / last modification time of file. When new file is created for copying, it gets the current time for creation and last-modification.
Problem 5:
The output file (destination) is has zero length when created. As input is file is empty, the output file is also empty as it should be.
Problem 7:
The wasted space is between allocation units (i.e. files) and not inside them, this is external fragmentation.
Problem 8:
Just lookup the pathname string as filename in the directory. It works. For relative pathnames, it should be expanded to full pathname by string operation using the string for current as prefix and then looked up.
Problem 9:
bitmap needs B bits. Freelist needs DF bits. Freelist is better if DF < B which can be put as F/B < 1/D - F/B is the fraction of free blocks. For 16 bit block addresses, freelist takes less space, if 6% or less of disk is free.
Problem 10:
Blocks 1 and 6 are missing. Block 5 is both on freelist and in use. If not corrected, Block 5 could be on two files and that is serious in terms of consequences to the owners of the two files.
Problem 11:
Many files are short. If entire file can fit in i-node itself, only one disk access is needed to read the file instead of two. Even for larger files, one less disk access would be needed.
Problem 12:
The time neede is h + 40 x (1-h).
Problem 13:
Time per block has seek, latency and transfer. Latency+transfer is 125 msec in all cases. Only seek differs. For 13 cylinders it is 78 msec; for 2 cyls, it is 12 msec. So, for randomly placed files, the total is 203 msec and for clustered files, 137 msec