Homework 9

Due 3/30/2012 [start of section]

Problem 1

Suppose I have 10 disks with an advertised failure rate of 1% per 10K hours, and that I arrange these disks into two groups of 5 disks per group. In each group, I use a 4 data + 1 parity RAID arrangement. Assuming independent failures and a mean time to repair of 1 hour, what is my expected mean time to data loss?

Problem 2

Is it possible to have a MTTR of 1 hour for the 320GB SATA drive described here?

Problem 3

Consider a highly-simplified version of the log-structured file system (LFS). You are supposed to write some code that models the cleaner. Specifically, go through each update in a segment and figure out whether the update has a *live inode* n it. If you find a live inode, print "LIVE", otherwise print "DEAD."

Here are some data structure definitions to help you out:

  // The inode map: records (tnumber) -> (disk address) mapping.
  // Assume disk address stored here is in bytes.
  unsigned int imap[MAX_INODES];

   typedef struct __inode_t {
       int direct[10]; // just 10 direct pointers
   } inode_t;

   typedef struct __update_t {
       int inumber; // inode number of the inode in this update (in bytes)
       inode_t inode; // the inode
       int offset; // offset of data block in file, from 0 ... 9
       char data[4096]; // the data block
   } update_t;

   typedef struct __segment_t {
       int disk_addr; // disk address of this segment (in bytes)
       update_t updates[MAX_UPDATES]; // the updates in this segment
                                      // (assume all MAX_UPDATES are used)
   } segment_t;

   segment_t *segment; // start with this pointer to the segment in question

Write code to process a segment. Assume you are given a pointer to a segment_t (called 'segment'). Then go through each update in the segment, figure out whether the inode referred to in that update is live or not, printing "LIVE" or "DEAD" as you go.

Problem 4

Some RAID code has been lost. You have to write it!

Assume you have a RAID-4 (parity-based RAID + a single parity disk), with a 4KB chunk size, and 5 disks total as follows:

  DISK-0    DISK-1    DISK-2    DISK-3    DISK-4

  block0    block1    block2    block3    parity(0..3)
  block4    block5    block6    block7    parity(4..7)
  ...       ...       ...       ...       ...

Problem 5