2. Filesystems and inodes
One-liner. Names live in directories; everything else lives in the inode.
Memorize
- inode holds metadata + block pointers — not the filename; directory entries map names → inodes.
- Hard link = another name for the same inode (same filesystem). Symlink = a separate inode containing a path.
- Deleting a file removes the directory entry and decrements the link count; space returns when the count hits 0 and no process holds it open.
dfreports filesystem blocks;dusums visible files — they disagree on deleted-but-open files and reserved blocks (~5% on ext4).- Mounts compose a single tree via the VFS;
/etc/fstabwith UUIDs survives device renames. - ext4 = journaled, mature; XFS = large files/parallel I/O; btrfs/ZFS = COW, snapshots, checksums.
stat,findmnt,lsblk -f,lsof +L1(deleted open files) are the diagnostic set.
Trap. "I deleted 40 GB but df is unchanged" — a process still holds the file open. Do this. lsof +L1 and restart the writer, or truncate via /proc/<pid>/fd/<n>.
Check
What happens to disk space when you rm a file that a running process still has open?
Why
The directory entry disappears but the inode's link count stays above zero until every open handle is closed.