Solution #1: The File System Checker
Learn how the fsck tool ensures file system crash consistency by checking the superblock, inodes, and directories for errors. Understand its operation phases, limitations, and performance challenges when repairing file systems after crashes.
We'll cover the following...
What is fsck
Early file systems took a simple approach to crash consistency. Basically, they decided to let inconsistencies happen and then fix them later (when rebooting). A classic example of this lazy approach is found in a tool that does this: fsck is a UNIX tool for finding such inconsistencies and repairing them; similar tools to check and repair a disk partition exist on different systems. Note that such an approach can’t fix all problems. Consider, for example, the case above where the file system looks consistent but the inode points to garbage data. The only real goal is to make sure the file system metadata is internally consistent.
What does fsck do
The tool fsck operates in a number of phases, as summarized in fsck assumes ...