Homework 2 Solution (15-412, Spring 2003)


Question 1 - Public Key Practicum

If you did this problem correctly, your hw2 directory will contain a $USER.message.decrypted file. If not, check to see if there is a $USER.ERROR file. If not, a popular problem is that you used file names other than the ones specified in the assignment, the grading script wasn't able to guess what you meant, and the grader hasn't yet had the time to manually intervene.

By the way, your encrypted messages to us were read and, generally, appreciated. The quote from "Sneakers" was particularly apropos.


Question 2 - RAID recovery

If you restored the data correctly, the missing column should read "Idaho". Why "Idaho"? Good question, ask Steve.


Question 3 - File System Layout

There are multiple reasons why putting all file system metadata at the beginning of the disk is a poor design choice. For example:

  1. Having all the inodes in one place, but having the directory blocks scattered throughout the file system, means that opening a file will frequently require a long seek, from the directory, which contains the name to inode mapping, to the inode area. Opening multiple files in the same directory will require ping-ponging the arm back and forth--slow! A similar argument applies even if the directories and inodes are together in a single area--opening several files and reading the first block from each will waste a lot of time waving the arm back and forth.
  2. If the inodes are in one place on the disk, the center of the disk would be better for several possible scheduling algorithms.
  3. If the disk experiences a media failure in the metadata area, all files will be lost.
It is probably wiser to divide the disk into regions, where each region contains some file data and some metadata. In the Berkeley "Fast File System" (FFS), the disk is indeed divided into regions called "cylinder groups". Each cylinder group has 1/Nth of the inodes and 1/Nth of the data blocks. The file system attempts to place files in a single directory within the same cylinder group.

As an aside, on older disks without Zone Bit Recording, the sectors at one extreme of the disk (beginning or end) were more reliable, since there was more magnetic medium per bit. Locating metadata at the "good end" was arguably a good design decision.