Filesystems and Storage

Lesson, slides, and applied problem sets.

View Slides

Lesson

Filesystems and Storage

Why this module exists

Filesystems are about structure and mapping. A path maps to an inode; an inode maps to blocks; blocks map to disk sectors. Correctness requires deterministic addressing and careful handling of indirection.


1) Inodes and block addressing

Inodes use a mix of direct and indirect pointers:

  • Direct blocks are stored in the inode.
  • Single indirect blocks point to a table of block pointers.
  • Double indirect blocks point to a table of tables.

This structure balances small-file efficiency and large-file capacity.


2) Disk scheduling

Disks are slow; seek time dominates. Scheduling algorithms reduce total seek distance:

  • FCFS: simple but often worst-case
  • SSTF: short-seek-first, can starve
  • SCAN/LOOK: sweep in one direction

What you will build

  • Inode block mapping with direct and indirect pointers
  • Disk scheduler simulation (LOOK)

Key takeaways

  • Filesystem correctness is about precise mapping.
  • Disk scheduling is a policy tradeoff between fairness and throughput.

Module Items