CPSC 261: Introduction to Computer Systems Practice questions #, April 2017 1. File Systems a. Why do solid-state disks have a much higher throughput for sequential write operations, where multiple adjacent pages are written to, than for random write operations? Solution : Before an already occupied page P on a block B can be written to, the other pages on block B must be relocated, and block B must be erased. Random write operations thus require multiple block erasures, which are relatively slow. Sequential write operations will require fewer block erasures, since once a block has been erased all pages on this block can be written to without needing to re-erase the block. b. Most file systems uses a relatively small block size (4K or so). (i) What is the main disadvantage of using such a small block size? Solution : We would obtain better throughput with a larger block size, because the most expensive part of a disk read operation, for rotating disks, is the time required to move the disk head to the first sector that we want to read. (ii) How do file systems attempt to reduce the impact of this disadvantage? Solution : They read multiple adjacent blocks whenever possible, and try to store each files using adjacent disk blocks. c. You absent-mindedly ran an executable sent by a friend while you were logged in as ad- ministrator on a Linux system. This executable erased the bitmap of your EXT4 (Linux) partition that contained the information about which blocks are in use, and which ones are free. After having a "chat" with your (former) friend, you start thinking about the problem you now have. Will you be able to recover the data from the file system? If so, why? If not, why not? Solution : Yes: by going through all of the inodes of the disk (or, if the only damage was to the block bitmap, visiting all of the files and directories on the file system), you can determine which blocks are currently in use. Once you have this information, rewriting the correct bitmap is simple. d. On a solid-state disk, a logical block is not always physically located at the same place on the disk. Why not? Solution : It is because an update to a page requires erasing the entire block, or rather, moving the entire block somewhere else that's already erased. So the logical blocks (not the same as the Blocks on the SSD device) move during this remapping process. e. How long, on average, will it take to read one 4096 bytes logical block on a file system that is stored on a hard disk with average seek time of 5ms, 6000 rotations per minute, 500 sectors per track, and where each sector contains 512 bytes? 1
Solution : One rotation of the disk takes 60/6000 = 0.01s = 10ms. The operation will thus take · An average of 5ms to seek to the correct track. · An average of 0.5