Date: Mon, 11 Nov 1996 17:25:03 GMT Server: NCSA/1.5 Content-type: text/html Last-modified: Thu, 25 Apr 1996 13:55:34 GMT Content-length: 2641 CS 537 - Quiz #9
UNIVERSITY OF WISCONSIN-MADISON
Computer Sciences Department
CS 537
Spring 1996
Bart Miller
Quiz #9
Wednesday, April 24

File Systems

1. Unix File Sizes

Consider the old UNIX file system (Version 7 or 4.1BSD). Assume that disk blocks are 1K bytes and each pointer to a disk block requires 4 bytes. What is the largest possible file using this design. Show your work (as an expression) to make sure you get credit; if your expression is correct, you will get full credit.

The old UNIX file system has 10 direct pointers to data blocks in the i-node, plus a pointer to a single-indirect block that contains pointers to 256 additional data blocks, plus a pointer to a double-indirect block that contains pointers to 256 blocks that each contain pointers to 256 additional data blocks, plus a pointer to a triple-indirect block that contains pointers to 256 blocks that each contain pointers to 256 blocks that each contain pointers to 256 additional data blocks:

Data blocks pointed to by i-node: 10
Data blocks pointed to by single-indirect block: + 256
Data blocks pointed to by double-indirect block: + 256 * 256
Data blocks pointed to by triple-indirect block: + 256 * 256 256

Total Number of Blocks: 16,843,018

Number of bytes per block:: x 1,024
Total Number of Bytes: 17,247,250,432

2. Unix File Access Speed

Assume that you have the Unix file system presented above in Problem 1. Also assume that the operating system has already read the i-node for your file into memory (RAM). How many additional disk reads will be required to read data block number 300 into memory? To assure full credit, list each additional disk read.

Three (3) additional reads are necessary:

  1. Read the first indirect block for double indirection.
  2. Read the second indirect block (for blocks 267-522)
  3. Read the data block for block 300.

Last modified: Thu Apr 25 08:52:12 CDT 1996 by bart