File Systems
Inodes, directories, mounting, and how journaling keeps your data safe across crashes.
What a file system actually is
A disk is just a long array of blocks (512 bytes or 4 KB each). A file system is a data structure laid out on top of those blocks that lets you say 'give me the file at /home/ada/notes.txt'.
Inodes
On Unix-style file systems, every file has an INODE — a fixed-size record holding metadata (size, owner, permissions, timestamps) plus pointers to the data blocks. The FILE NAME is stored separately, in directory entries. This is why you can have multiple names (hard links) pointing to the same file.
Directories
A directory is just a special file containing a list of (name, inode-number) pairs. When you cd into a directory and `ls`, the OS reads its contents and prints the names.
Mounting
Different file systems (your SSD, an external drive, a network share, the in-memory /proc) get attached to a single hierarchical tree at MOUNT POINTS. /mnt/usb might be the USB drive; /home a separate partition. From the user's view, it's all one tree.
Journaling — surviving crashes
Naively writing changes to disk is dangerous: if the power dies halfway through updating a file's metadata and data, you're left with corrupt structures. Modern file systems (ext4, NTFS, APFS) use a JOURNAL — an append-only log of intended changes. On crash recovery, replay the journal and the file system returns to a consistent state.