Repairing File Systems

Some disk data is kept in memory temporarily before being written to disk, for performance reasons (see the previous discussion of the sync mount option). If the kernel does not have an opportunity to actually write this data, the file system can become corrupted. This can happen in several ways:

  • The storage device (for example, a floppy disk) can be manually removed before the kernel has finished with it.

  • The system might suffer a power loss during a storm or power surge.

  • 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 file systems. Most of the time, the boot follows a controlled shutdown (see ...

Get Practical Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.