File systems

Please work out pre-lab problems before your next lab section. The GSI/IAs will go over all problems during the lab section.

Use the fs_inode and fs_direntry data structures from Project 4 (from fs_server.h) Note: Blocks are 512 bytes, and inodes are block-sized.

[pre-lab] 1.

What is the minimum and maximum number of disk blocks that must be brought into memory in order to read the first block of the file /etc/passwd?

[pre-lab] 2.

A big file /bigfile that is 4 blocks in size is stored in the file system.

A. Draw out how /bigfile is laid out on disk. Include all inodes and data blocks required to store the file. Assume there are no other files.

B. A user program makes a read request from offset 1 from /bigfile. How many disk accesses are required to process the request?

C. i) How many disk accesses are required to process a read request on offset 2 of /bigfile? ii) How many accesses would it be if we had cached the blocks from part b?

D. If we wanted to add a new directory, /foo, how many new disk blocks do we need to allocate? Update your diagram from part a with the new disk blocks.

E. A request for a new file, /foo/bar, has been made. How many new disk blocks do we need to allocate? Update your diagram from part a with the new disk blocks.