The simple version
A filesystem is a library catalogue. Each book has a catalogue card (an inode) saying who owns it, how big it is and which shelves its pages are on. The pages themselves sit on the shelves (data blocks).
If the library runs out of catalogue cards, it can't take a single new book even with empty shelves everywhere.
Inodes
An inode stores a file's metadata: mode, owner, size, timestamps and where its data lives. The file name lives in the directory entry that points at the inode, not in the inode itself.
$ stat train-00001.tar
$ df -i /data
df -i shows inodes used and free. Millions of tiny files can exhaust inodes long before bytes run out.
Extents
Old filesystems tracked every block of a file individually. ext4 and XFS use extents: "blocks 10,000 to 18,191 belong to this file" is one record. Large, contiguous files (like training shards and checkpoints) need very few extents, which keeps metadata small and reads sequential.
$ filefrag -v bigfile.binJournaling
A journal records metadata changes before they're applied, so after a crash the filesystem replays or discards incomplete operations instead of running a full check. By default both ext4 (data=ordered) and XFS journal metadata, not file contents.
XFS vs ext4 (concept level)
| ext4 | XFS | |
|---|---|---|
| Inode allocation | Fixed at mkfs time (set by bytes-per-inode, mkfs.ext4 -i) | Dynamic, up to a percentage of space (imaxpct) |
| Parallelism | Block groups | Allocation groups, designed for parallel I/O |
| Shrink | Offline shrink supported | Cannot shrink |
| Typical use | General purpose, boot volumes | Large files, local NVMe scratch, many storage servers |
$ xfs_info /data
$ sudo tune2fs -l /dev/sdb1 | grep -i inodeTools
df -h / df -iSpace used vs inodes used. Check both.
stat FILEInode number, size, blocks, timestamps.
filefrag -v FILEHow many extents a file uses.
xfs_info MOUNT / tune2fs -l DEVFilesystem geometry for XFS / ext4.
Quiz
Lab
Lab 1.3 · Disk full with free space
A preprocessing job on gpu-a dies with No space left on device when it creates files in /scratch, yet df -h shows the filesystem barely half full. The team already packed the loose image tiles into shards on Lustre at /lustre/datasets/tiles-shards, but never cleaned up.