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
100180
120220
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.

  1. SSTF

  2. LOOK

2. FAT Filesystems (10 points)

Consider the following parameters of a FAT based filesystem:

Answer the following questions, showing your work.

  1. What is the largest disk size supported by this filesystem?

  2. 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:

Answer the following questions, showing your work.

  1. What is the largest file size supported by this filesystem?

  2. 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:

Clearly justify your answers to the following questions.

  1. 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?

  2. 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?

  3. In a separate reboot following a crash, the following incomplete transaction is discovered in the journal:

    <transaction>
    <del /home/lee/bar>
    <free 40
    

    What action should be taken to ensure the filesystem is consistent?