Fsck
≈ 3 min read
Names in other languages
- astFsck
- DeutschFsck
- EnglishFsck
- EspañolFsck
- fiFsck
- FrançaisFsck
- gaFsck
- NederlandsFsck
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
The system utility fsck (file system check) is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux, macOS, and FreeBSD. The equivalent programs on MS-DOS and Microsoft Windows are CHKDSK, SFC, and SCANDISK.
The system utility fsck (file system check) is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux, macOS, and FreeBSD. The equivalent programs on MS-DOS and Microsoft Windows are CHKDSK, SFC, and SCANDISK.
Use
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 an fsck command tailored to the file system 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. On modern systems, fsck simply detects the type of filesystem and calls the specialized (Linux) or (BSD, macOS) program for each type. 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.
As a minced oath
The severity of file system corruption led to the terms "fsck" and "fscked" becoming used among Unix system administrators as a minced oath for "fuck" and "fucked". 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" That story was confirmed by Rob Pike on the Mastodon social network on December 17, 2023:
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
List of Unix commands List of file systems e2fsprogs, which includes the e2fsck utility, standard on many Linux distributions scrub, Oracle Solaris ZFS file system checking utility
References
External links
man fsck Checking and Repairing File system with fsck Jargon File entry: fscking The many faces of fsck
Text derived from https://en.wikipedia.org/w/index.php?oldid=1371796809 under CC BY-SA 4.0; modifications have been made.