fsck
Filesystem check and repair tool; runs after a crash to find dangling inodes and reconstruct the lost+found directory.
fsck (Filesystem Check) is Unix/Linux's answer to Windows `chkdsk`. The tool traverses filesystem structures—the inode table, bitmaps, directory entries—and detects inconsistencies. If an inode is referenced by a directory entry but marked free in the inode table, it is "orphaned," and fsck can move it to `lost+found`. If an inode references a bad block number, fsck can mark it free.
fsck typically runs in single-user mode during boot if the filesystem was not cleanly unmounted. Modern Linux uses `e2fsck` (for ext*), `xfs_repair`, etc.—often filesystem-specific tools. It is very slow on large volumes; inode bitmap optimizations reduced runtime from hours to minutes.