Repairing Filesystems
Some disk data is kept in memory temporarily before being written to disk for performance reasons. (See the earlier discussion of the sync mount option.) If the kernel does not have an opportunity to actually write this data, the filesystem can become corrupted. This can happen in several ways, for example:
The storage device (for example, a diskette) can be manually removed before the kernel has finished with it.
The system might suffer a power loss.
The Linux kernel locks up or reboots the system. Thankfully this is a very rare occurrence.
The user might mistakenly turn off the power or accidentally press the Reset button.
As part of the boot process, Linux runs the fsck program, whose job it is to check and repair filesystems. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access