Assignment 5: Disks and File systems
Your solutions should be turned in via the Blackboard assignments section as a PDF, Microsoft Word, or plain text document. The point worth of each problem is indicated; the assignment is worth a total 40 points.
1. Disk head scheduling (10 points)
Consider the following table of block requests and arrival times:
| Block # | Arrival time |
| 50 | 0 |
| 30 | 50 |
| 80 | 100 |
| 25 | 130 |
| 100 | 180 |
| 120 | 220 |
| 75 | 250 |
| 15 | 300 |
The disk head is initially positioned over block 0. Seeking across n blocks requires 20+2n ms, and access times can be ignored. Assume that once a block has been scheduled, subsequent arrivals (even intervening ones) will not be considered until the scheduled block has been serviced.
For each of the following disk head scheduling algorithms, list the order in which block requests are serviced, and the resulting seek times.
SSTF
LOOK
2. FAT Filesystems (10 points)
Consider the following parameters of a FAT based filesystem:
- Blocks are 1KB (1024) bytes large
- FAT entries are 32 bits wide, of which 24 bits are used to hold a block number
- Two copies of the FAT are maintained on disk at all times, for redundancy
Answer the following questions, showing your work.
What is the largest disk size supported by this filesystem?
For a 128MB disk, how much space must be set aside to hold the FAT structures?
3. I-Node Filesystems (10 points)
Consider the following parameters of an i-node based filesystem:
- Blocks are 1KB (1024 bytes) large
- Block pointers are 64-bits (8 bytes) wide
- Each i-node contains 10 direct pointers, 2 single indirect pointers, 2 double indirect pointers, and 1 triple indirect pointer
Answer the following questions, showing your work.
What is the largest file size supported by this filesystem?
After opening a file that is approximately 10MB in size and loading its i-node into memory, a system call is issued to skip to the middle of the file. Describe the resulting sequence of block requests that must be carried out.
4. Journaling (10 points)
The file deletion operation in UNIX can be accomplished in the following three steps:
- Remove the file entry from the containing directory
- Mark the file i-node as being free
- Mark the file data blocks as being free
Clearly justify your answers to the following questions.
If we were to implement a system of soft updates such that, in the event of a system crash in the middle of a file deletion the worst that could happen was "leaked" disk space, what order would we perform the above operations in?
Now consider a filesystem with journaling support. Upon reboot following a crash, the following uncommitted transaction entry is discovered in the journal:
<transaction> <del /home/lee/foo> <free 319> <free 12019> </transaction>What action should be taken to ensure the filesystem is consistent?
In a separate reboot following a crash, the following incomplete transaction is discovered in the journal:
<transaction> <del /home/lee/bar> <free 40What action should be taken to ensure the filesystem is consistent?