Jump to content

fsck

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Alarob (talk | contribs) at 02:07, 8 January 2016 (Examples: uppercase acronym, wlink). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


fsck in action on a Linux system.

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.[1]

Pronunciation

Like many computer jargon terms without vowels, fsck is essentially unpronounceable in most languages and so people are forced to improvise when speaking it aloud. It can be pronounced "F-S-C-K", "F-S-check", "fizz-check", "F-sack", "fisk", "fizik", "F-sick", "F-sock", "F-suck" (associated with how long it takes to run [2]), "F-sek", the sibilant "fsk", "farsk" or "fusk".

Use

Generally, fsck is run either automatically at boot time, or manually by the system administrator. The fsck command works directly on data structures stored on disk, which are internal and intrinsically specific to a file system implementation. A matching fsck command that is tailored specifically to the design of the file system is often provided by the authors of a file system. 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. Because running fsck to repair a file system which is mounted for read/write operations can potentially cause severe data corruption/loss, the file system is normally checked while unmounted, mounted read-only, or with the system in a special maintenance mode that limits the risk of such damage. A journaling file system is 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. The modern and faster ZFS in FreeBSD, FreeNAS and PC-BSD has no "fsck" repair tool; instead, it has a repair tool called "scrub" which examines and repairs Silent Corruption and other problems. Additionally ZFS uses copy-on-write, intelligent data scrubbing and resilvering (resyncing).[3] While fsck must be run on an unmounted and therefore unusable filesystem, scrub does not need the ZFS filesystem to be taken offline. scrub is designed to be used on a mounted filesystem. While fsck usually only checks metadata, such as the journal log, but never checks the data itself, scrub checks everything, including metadata and the data. It is also possible to simply swap a harddisk drive to a larger drive and resilver (repair) the zpool of disks. The ZFS file system was designed from the ground up with a focus on data integrity and protection against silent data corruption caused by bit rot, current spikes, bugs in disk firmware, ghost writes, and so on.

The equivalent programs on Microsoft Windows and MS-DOS are CHKDSK and SCANDISK.

Use as profanity

Before the rise of journaling file systems, it was common for an improperly shut-down Unix system's file system to develop a corrupted superblock. This possibly-serious problem could only be resolved by running fsck, which could take anywhere from a few seconds to hours, depending on the volume's size and disk I/O throughput. Because of the severity of fsck not being able to resolve this error, the terms "fsck" and "fscked" have come into use among Unix system administrators as a minced oath for "fuck" and "fucked".[4]

It is unclear whether this usage was cause or effect, as a report from a question and answer session at USENIX 1998 claims that "fsck" originally had a different name.

Dennis Ritchie: “So fsck was originally called something else”
Question: “What was it called?”
Dennis Ritchie: "Well, the second letter was different"[5][6]

Another online use of the term, not really profanity but a curt way of dismissing someone, was "Go fsck yourself", meaning to go and correct your issue (attitude, ignorance of the subject matter, etc.) before posting again. This takes the fsck process as a metaphor, since running fsck involves fixing fundamental errors on the file system before continuing work on it.

Examples

The following example checks the file system configured to be mounted on /usr partition; the file system needs to be unmounted first:

 fsck /usr

The following example checks the Linux JFS file system on a mdadm software RAID device:

 fsck -t jfs /dev/md0

See also

References

  1. ^ "fsck(8) - Linux man page". die.net. Retrieved 7 May 2013.
  2. ^ Example USENET post
  3. ^ "Smokin' Mirrors". Jeff Bonwick's Weblog. May 2, 2006. Retrieved February 23, 2007.
  4. ^ Raymond, Eric S (September 24, 1999). "fscking". The Jargon File. Archived from the original on 2010-01-03. fscking: /fus'-king/ or /eff'-seek-ing/ adj. [Usenet; common] Fucking, in the expletive sense (it refers to the Unix filesystem-repair command fsck(1), of which it can be said that if you have to use it at all you are having a bad day). Originated on {scary devil monastery} and the bofh.net newsgroups, but became much more widespread following the passage of {CDA}. Also occasionally seen in the variant 'What the fsck?'
  5. ^ https://groups.google.com/forum/#!msg/alt.sysadmin.recovery/tsGbbkvHo2c/6T-Pj9d3A6wJ
  6. ^ http://www.c2.com/cgi/wiki?MindFsck