C502 – Operating Systems Tutorial ∗
File Systems
1. Explain what it means to “defragment a file system”? Are there file systems that do not require
defragmentation? How can a file system reduce the amount of fragmentation?
2. Assume that we are using i-nodes. Consider a file system that maintains a unique i-node for each file
in the system. Each i-node includes 8 direct pointers, a single indirect pointer, and a double indirect
pointer. The file system block size is 1024 (210) bytes, and a block pointer occupies 4 bytes.
How many disk operations will be required if a process reads data from the Nth block of a file? Assume
that the file is already open, the buffer cache is empty, and each disk operation reads a single file block.
Your answer should be given in terms of N.
3. Consider a file system that uses i-nodes with single-indirect and double-indirect blocks and a block size
of 1024 (210) bytes. If the block size of the file system is doubled, by approximately what factor does
the maximum possible file size increase? Your answer should be an integer.
4. Assuming that we are using i-nodes to maintain file information. Why is the information maintained
in main memory for an open file larger than that for a closed file. What does this extra information
represent? (Exam question in 2016-17).
∗with thanks to Roman Kolcun