Please work out these problems before your next discussion section. The GSIs will go over these problems during the discussion section.
Consider a file system which uses a hierarchical directory structure with an inode for each file and directory. What is the number of disk blocks that must be brought into memory in order to completely read the first block of the file /etc/passwd? Assume that nothing is currently cached in memory, and that each inode (for files and directories) fits in one disk block.
Suppose we have a file system with a single huge file bigfile. Also assume that the disk block size is 1000 bytes. A user program makes the following read requests from "bigfile":
The file has a file header (inode), which takes up one disk block and is not in memory. What is the number of disk accesses required to process each of the requests for the following different file structure schemes? (assume that there is no caching of any disk blocks from request to request).
The inode contains 10 direct pointers and 2 indirect pointers. The direct pointers point to data blocks. An indirect pointer points to one disk block (called indirect block) that contains pointers to data blocks. Assume that size of each pointer in the indirect block is 4 bytes and there is no caching of anything.