File Systems

Main Goal of file systems

  • Don’t go away: From boot up to shut down
  • Associate bytes with name (files)
  • Associate names with each other (directories)

Secondary storage

Files

File systems vs. Virtual Memory

FS has an easier job than VM

FS is harder

Performance of File Systems

Common patterns

How to track all file’s data?

Attempt 1: Contiguous Allocation

Attempt 2: Linked Files

Attempt 3: FAT

Attempt 4: Indexed Files

Attempt 5: Multi-level Indexed Files

Directories

Naming Magic

Where do you start looking for a file

  • Root directory always inode #2
    • Inodes 1 and 2 are reserved for bad blocks

Special names

Current working directory (cwd)

Speeding up FS

Fragment Allocation

Block Allocation

Cluster writes

Crash Recovery

XFS

Contiguous Allocation