*** Welcome to piglix ***

Fsck


The system utility fsck (for "file system consistency check") is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux and OS X. A similar command, CHKDSK exists in Microsoft Windows.

There is no agreed pronunciation. It can be pronounced "F-S-C-K", "F-S-check", "fizz-check", "F-sack", "fisk", "fizik", "F-sick", "F-sock", "fuck", "fucked", "F-suck" (associated with how long it takes to run), "F-sek", the sibilant "fsk", "farsk" or "fusk".

Generally, fsck is run either automatically at boot time, or manually by the system administrator. The command works directly on data structures stored on disk, which are internal and specific to the particular file system in use - so a matching fsck command tailored is generally required. The exact behaviors of various fsck implementations vary, but they typically follow a common order of internal operations and provide a common command-line interface to the user.

Most fsck utilities provide options for either interactively repairing damaged file systems (the user must decide how to fix specific problems), automatically deciding how to fix specific problems (so the user does not have to answer any questions), or reviewing the problems that need to be resolved on a file system without actually fixing them. Partially recovered files where the original file name cannot be reconstructed are typically recovered to a "lost+found" directory that is stored at the root of the file system.

A system administrator can also run fsck manually if they believe there is a problem with the file system. The file system is normally checked while unmounted, mounted read-only, or with the system in a special maintenance mode.

Modern journaling file systems are designed such that tools such as fsck do not need to be run after unclean shutdown (i.e. crash). The UFS2 Filesystem in FreeBSD has a background fsck, so it is usually not necessary to wait for fsck to finish before accessing the disk. Full copy-on-write file systems such as ZFS and Btrfs are designed to avoid most causes of corruption and have no traditional "fsck" repair tool. Both have a "scrub" utility which examines and repairs any problems; in the background and on a mounted filesystem.


...
Wikipedia

...