The assignment is to handed in class. No late assignments will be accepted.
One way to use file system's allocation of a disk and not suffer from holes is to compact the disk (i.e., move the files together to remove the holes) every time a file is deleted. Since all files are contiguous, copying a file requires a seek and rotational delay to read the file, followed by the transfer at full speed. Writing the file back requires the same work. Assuming a seek time of 6ms, a rotational delay of 4ms, a transfer rate of 5MB/sec, and an average file size of 8KB, how long does it take to read a file into main memory and then write it back to the disk at a new location? Using these numbers, how long would it take to compact half of a 16GB disk?
In light of the answer to the previous question, does compacting the disk ever make sense? Explain your answer.
Two computer science students, John and Mary, are having a discussion about i-nodes. John maintains that memories have gotten so large and so cheap that when a file is opened, it is simpler and faster just to fetch a new copy of the i-node into the i-node table, rather than search the entire table to see is it is already there. Mary disagrees. Who is right? Justify your answer.
List four ways a system could use to determine which blocks on a disk are free.
Give advantages of each way.
What are the advantages and disadvantages of recording the name of the creating program with the file's attributes (as is done in the Macintosh operating system)?
Suppose that an inode is 128 bytes, pointers are 4 bytes long, and
the status information takes up 68 bytes. Assume a block size of
8K bytes and block pointers of 32 bits each.
(a) How much room is there for direct pointers in the inode?
(b) How big a file can be represented with direct pointers?
(c) How big a file can be represented with single Indirect pointers?
(d) How big a file can be represented with Double Indirect pointers?
(e) How big a file can be represented with Triple Indirect pointers?
Consider a system that supports 5000 users. Suppose you want to allow 4990 of these users to be able to access one file. How would you specify this protection scheme in UNIX?
Consider the following backup scheme:
Consider a file system on a disk that has both logical and physical block sizes of 512 bytes. Assume that the information about each file is already in memory and each disk address contains 1 bytes. For each of the three allocation strategies (Contiguous, linked, and indexed), answer these questions:
How many disk operations are needed to fetch the i-node for the file /home/teacher/courses/os/handout.html? Explain your answer. Assume that the root directory is in memory, but nothing else along the path is in memory. Assume also that each directory file fits in one block.
**********************************************************************