COSC240 • Operating Systems

Week 10: File Management & Storage Systems

Having examined process scheduling, synchronization, and volatile memory virtualization, we confront the challenge of persistence. We analyze how the kernel virtualizes non-volatile physical storage blocks into structured, named byte streams: File Abstractions, Directory Trees, Inode Allocation Schemes, and Crash Consistency via Journaling.

📚 What You Will Learn
  • The fundamental File Abstraction: unformatted byte streams vs. record sequences and database key trees.
  • POSIX file descriptors, open file description tables, and VFS inode table interaction across fork() and dup().
  • Directory topologies, recursive path resolution, hard links vs. symbolic links, and link count invariants.
  • On-disk allocation structures: Contiguous allocation, File Allocation Tables (FAT), and UNIX Inode multi-level block pointers.
  • Crash consistency, Write-Ahead Logging (WAL), journaling modes (data vs. metadata), and filesystem recovery (fsck).
✅ What You Should Do
  • Read Tanenbaum & Bos Chapter 4 (File Systems) and OSTEP Chapters 39–42.
  • Work through Modules 01 to 04 sequentially, tracing block pointer indirection and inode structures.
  • Complete Theory Tutorial 10 (Inode Maximum File Size Calculations & Indirect Blocks).
  • Complete Practical Tutorial 10 (Implementing a Simple File System Directory Parser in C).
  • Prepare for Quiz 5 (covering Virtual Memory, Paging, and File System Implementations).
📂 Course Modules & Deep-Dive Texts
Module 01

The File Abstraction

Analyze how the operating system abstracts physical storage blocks into named, linear byte streams. Study file metadata (stat/inode), access modes, and the kernel's 3-tier descriptor architecture.

Byte Streams struct stat FD Table VFS Inodes
Launch Module 01 →
Module 02

Directories & Path Resolution

Investigate directory file layouts, linear and hashed directory entries, hierarchical pathname resolution from root, and the critical mechanical differences between hard links and symbolic links.

Directory Entries Path Resolution Hard Links Symlinks
Launch Module 02 →
Module 03

File System Implementation

Dissect on-disk physical layouts: contiguous allocation, chained lists, File Allocation Tables (FAT), and UNIX Inodes with direct, indirect, double-indirect, and triple-indirect block pointers.

FAT Table UNIX Inodes Indirect Blocks Free-Space Bitmaps
Launch Module 03 →
Module 04

File System Management & Optimization

Examine buffer cache architectures, read-ahead caching, disk defragmentation, crash consistency protocols, Write-Ahead Logging (WAL), and journaling filesystems (ext4, NTFS, ZFS).

Buffer Cache Journaling Crash Consistency fsck Recovery
Launch Module 04 →
🔮 Interactive Visualizers & Simulation Laboratories

Descriptor Tracer

Trace file descriptor indirection across fork(), dup2(), and independent open() calls.

Open Tracer →

Directory Traversal

Step through recursive path resolution, inode lookups, and hard link link-count mechanics.

Open Traversal Lab →

Inode Pointer Walk

Calculate file offsets and navigate direct, indirect, and double-indirect block arrays.

Open Inode Calculator →

Journaling & WAL

Simulate power loss mid-transaction to observe Write-Ahead Logging crash recovery.

Open Journaling Sim →