Homework 11: Chapter 11 Questions


Due: Thursday, April 12th by 5:59 PM

Header

Please put the following at the top of a flat text file, hwk11.txt:

Homework Questions

Write the answers to the following questions in hwk11.txt:
  1. Consider a file currently consisting of 11 blocks. Assume that the file-control block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations (reads and writes collectively) are required for contiguous, linked, and indexed (single-level) allocation strategies, for the following scenarios. In the contiguous-allocation case, assume that there is no room to grow at the beginning but there is room to grow at the end. Also assume that the block information to be added is stored in memory. Pay special attention to what is in the directory for each of the schemes.

    Scenarios:
    a. A block is added at the beginning.
    b. A block is added in the middle (between block indices 5 and 6).
    c. A block is added at the end.
    d. The first block is removed.
    e. Block index 5 is removed.
    f. The last block is removed.
       Contiguous   Linked	Indexed
    a.
    b.
    c.
    d.
    e.
    f.
    
  2. Consider a system that supports contiguous, linked, and indexed allocation schemes. What criteria should be used in deciding which strategy is best utilized for a particular file?
  3. What are the advantages of the variation of linked allocation that uses a FAT to chain together the blocks of a file?
  4. Consider a file system similar to the one used by UNIX with indexed allocation. How many disk I/O operations might be required to read the contents of a tiny local file at /a/b/c? Assume that none of the disk blocks is currently being cached.
  5. Explain how log-based transaction-oriented file systems ensure consistency of metadata.

Submission

Submit hwk11.txt using the handin program. For example, for this homework, type the following in a terminal exactly as it appears:
  handin  hwk11  hwk11.txt

Alternatively, you can submit the assignment from any computer via PeerSpace. After successfully logging into PeerSpace, go to Tools, then Assignments. Click on the Submit link.


Hints

  1. For problem #1, count each time a block is read or written. If a block is moved, then that's a read and a write. Additionally, remember to account writes to the directory (if applicable).