When you save a document, your disk does not archive it as a single whole. It chops it into thousands of pieces and scatters them across the surface of the magnetic platter (or across the flash-memory cells, if it is an SSD). The one that keeps track of which piece goes where is the file system: the software that turns a pile of anonymous blocks into the folder and file structure you see in your file manager.
The disk does not understand files
A hard disk is, at heart, a surface divided into blocks (also called sectors or clusters), units of fixed size, usually 4 KiB. The disk only knows how to write and read numbered blocks. It has no idea what a “file” is. It is the file system that imposes that meaning: it groups blocks, gives them names and organizes them into hierarchies.
The inode: the file’s record card
In classic Linux file systems (ext4, for example), every file has a record called an inode. The inode stores the metadata: permissions, owner, dates and, above all, the list of blocks that make up the file. What you see as a name in a folder is only a link (a directory entry) pointing to an inode. That is why a file can have several names (hard links) without duplicating the data: they all point to the same record.
Fragmentation: when blocks scatter
At first, a new file is written to contiguous blocks. But as you delete and create files, the free gaps spread across the whole disk. The file system then spreads the file across non-consecutive blocks: that is fragmentation. The file stays readable, but the read head has to jump back and forth, and access slows down. On SSDs fragmentation matters less, because there are no moving parts: any cell is read at the same speed.
Journaling: the diary that prevents corruption
If the system powers off in the middle of a write, the file can be left half-finished. To avoid this, modern systems use journaling: before touching the data, they log in a journal which operation they are about to perform. If the system crashes, on boot they read the journal and complete or undo the pending operation. It is the difference between a disk that recovers on its own and one that gets corrupted.
Beyond ext4: copy-on-write and checksums
The most modern file systems (Btrfs, ZFS) go further. They use copy-on-write: they never overwrite a block in use, they write the new copy elsewhere and update the pointer at the end. That allows nearly free snapshots and prevents a mid-write failure from leaving a file half-finished. They also store checksums of every block, so they can detect and repair silent data corruption, something ext4 does not do.
The file system as a contract
In the end, the file system is a contract between hardware and software: the disk promises blocks, and the file system promises that those blocks mean something. Every time you save a file, you are trusting that invisible layer that decides where each piece of your data lives.





