Abstract Requirements

Persistent Storage: Store large data, survive process termination, concurrent access

Abstract File Operations

Directories: Logical tree structure

Links

Implementations

Directory FIle Structure

Allocation Strategies

Hardware Definitions

Contiguous Allocation: For each file, point to start block and length (like malloc)

Linked Allocation: (FAT32) Point to a starting block, and each block point to the next block

Indexed Structure: (Unix ext2 inode)

Extent-based Allocation: TODO 11-22 1:00

File System Structure / Formatting

Superblock: Well-known location that store metadata about the overall file system.

Free Space Bitmap: Track which blocks are free

Inode: FS metadata object

Inode Table: Array DAT for inodes, allocated on mkfs

Free Inode Bitmap: Track which inode is free

Root Directory: Stored in the first data block, inode 0

Untitled

Directory Data Block: Map file names under a directory to their inode numbers

File System Operations

Open: Cache the file inode in an “open” file table, return a fd (file descriptor)

Optimization

ext2 Long Seek Problems

  1. Fragmentation: After a long time, free space and new files will be scattered by deletes
  2. Inodes and actual content are placed far from each other

Berkeley Fast FS: A device-aware fs

NTFS

Master File Table (MFT): Like inode table, sequence of 1kb records

Untitled

Untitled

Extent based allocation: Allocate files in consecutive blocks