Home|Contents|Prev|Next|Chat


CSC 711 Answers 2 - File systems

OS-Q2 FAT vs System V vs FFS

On-disk layout. FAT: boot sector (BPB) -> two FAT copies -> root directory -> data clusters. System V: boot block -> superblock -> inode list -> 1 KB data blocks. FFS: disk split into cylinder groups, each with a superblock copy, inode bitmap, block bitmap, inode array and 4 KB data blocks (+fragments).

Locating data. FAT uses linked allocation: directory entry stores the first cluster; FAT[cluster] gives the next cluster (0=free, end-of-chain marker); follow the chain. System V uses indexed allocation: the inode has 10 direct + single/double/triple indirect pointers. FFS uses the same inode model but with 4 KB blocks and fragments, and places related data in one cylinder group.

Optimisation. FAT: simple, cache the FAT, but random access walks the chain and it fragments. System V: free inode/block lists for fast allocation, but inodes sit at the start and data after -> long seeks, poor locality. FFS: cylinder groups (locality), large blocks (bandwidth), fragments (small files), bitmaps (fast allocation) -> about 10-20x throughput over System V.

Key axis: linked (FAT) -> indexed (System V) -> indexed + locality (FFS).

OS-Q2b How FFS cylinder groups improve on System V

In System V inodes are at the start and data after, so every open causes a long head travel, and the free list scatters a file's blocks. FFS makes each cylinder group a self-contained mini-filesystem:

Net effect: roughly an order-of-magnitude throughput gain. Keyword: locality of reference.


Home|Contents|Prev|Next|Top|Chat