Fast File System for Unix

Physical Disk

Seek time is the time spent physically move the arm head.

Cylinder group is the cylinders that are close to each other.

Old File System

Superblock - contains the basic parameters of the file system. The number of data blocks in the FS, a count of the maximum number of files, and a pointer to the free list.

Within the FS are files. Certain files are distinguished as directories and contain pointers to files that may themselves be directories.

Every file has a descriptor associated with it called an inode. An inode contains info describing ownership of the file, timestamps marking last modification and access times for the file, and an array of indices that point to the data blocks for the file. An inode may also contain references to indirect blocks containing further data block indices.

Problems

Block Size

Block size is too small. Larger block size can give more throughput, but the disk waste will also grow.

Fragmentation

Blocks allocated randomly over the disk, forcing a seek before every block access.

New File System

Cylinder groups

The new FS divides a disk partition into one or more areas called cylinder groups. A cylinder group is comprised of one or more consecutive cylinders on a disk. Associated with each cylinder group is some bookkeeping information that includes a redundant copy of the superblock, space for inodes, a bit map describing available blocks in the cylinder group, and summary information describing the usage of data blocks within the cylinder group.

All the cylinder group bookkeeping information could be placed at the beginning of each cylinder group. But this will make all the redundant information on the top platter, which is not safe. Thus the cylinder group bookkeeping info begins at a varying offset from the beginning of the cylinder group. In this way, any single track, cylinder, or platter can be lost without losing al copies of the superblock.

Storage utilization

Bigger block brings disk consumption waste for small files. To solve this, a single FS block is divided into one or more fragments. The block map associated with each cylinder group records the space available at the fragment level.

Layout Policies

There are two parts, global policies and local policies.

Global

Inodes - Places all the inodes of files in a directory in the same cylinder group.

Data blocks - Place all data blocks for a file in the same cylinder group.

Local

4 levels of allocation strategy when a requested block is not available. For disk manufacturers, they do not guarantee that every block on the disk is usable.

Performance

Write - Async

Read - Sync

In the old FS, due to the async, write is about 50 % faster than read. But in the new FS, the cost of allocation causes the writes to be slower than reads.