Checking Filesystems

The Linux ext2 filesystem is fairly robust. However, if you try hard enough, you can corrupt it. The easiest way to do this is to simply turn the system off without performing a proper shutdown. (Kicking the plug out of the wall accomplishes the same goal if you don't have a UPS.)

Why is this bad? Because Linux, like most UNIX systems, maintains information about files it has accessed in memory (buffers). When these buffers change, they aren't immediately written to disk. These changed buffers are said to be dirty. The system occasionally flushes the buffers to the disk to bring the memory and disk into sync, which is called syncing the disk. You can do this manually by typing sync. Custom dictates doing this several (usually ...

Get Special Edition Using Linux®, Sixth Edition 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.