HOME

TheInfoList



OR:

The system utility fsck (''file system consistency check'') is a tool for checking the consistency of a
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one lar ...
in
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
and Unix-like operating systems, such as
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which in ...
,
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lap ...
, and
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular op ...
. A similar command,
CHKDSK In computing, CHKDSK (short for "check disk") is a system tool and command in DOS, Digital Research FlexOS, IBM/Toshiba 4690 OS, IBM OS/2, Microsoft Windows and related operating systems. It verifies the file system integrity of a volume and at ...
, exists in
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for se ...
and its predecessor,
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few oper ...
.


Pronunciation

There is no agreed pronunciation. It can be pronounced "F-S-C-K", "F-S-check", "fizz-check", "F-sack", "fisk", "fishcake", "fizik", "F-sick", "F-sock", "F-sek", "feshk", the sibilant "fsk", "fix", "farsk" or "fusk".


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. 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 A system administrator, or sysadmin, or admin is a person who is responsible for the upkeep, configuration, and reliable operation of computer systems, especially multi-user computers, such as servers. The system administrator seeks to en ...
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 system A journaling file system is a file system that keeps track of changes not yet committed to the file system's main part by recording the goal of such changes in a data structure known as a "journal", which is usually a circular log. In the even ...
s are designed such that tools such as fsck do not need to be run after unclean shutdown (i.e. crash). The UFS2 file system in
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular op ...
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 ZFS (previously: Zettabyte File System) is a file system with volume management capabilities. It began as part of the Sun Microsystems Solaris operating system in 2001. Large parts of Solaris – including ZFS – were published under an open ...
and
Btrfs Btrfs (pronounced as "better F S", "butter F S", "b-tree F S", or simply by spelling it out) is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager (not to be confused w ...
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 file system. The equivalent programs on
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few oper ...
and
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for se ...
are
CHKDSK In computing, CHKDSK (short for "check disk") is a system tool and command in DOS, Digital Research FlexOS, IBM/Toshiba 4690 OS, IBM OS/2, Microsoft Windows and related operating systems. It verifies the file system integrity of a volume and at ...
and SCANDISK.


As an expletive

The severity of file system corruption led to the terms "fsck" and "fscked" becoming used among Unix system administrators as a
minced oath A minced oath is a euphemistic expression formed by deliberately misspelling, mispronouncing, or replacing a part of a profane, blasphemous, or taboo word or phrase to reduce the original term's objectionable characteristics. An example is "gosh" ...
for "
fuck ''Fuck'' is an English-language expletive. It often refers to the act of sexual intercourse, but is also commonly used as an intensifier or to convey disdain. While its origin is obscure, it is usually considered to be first attested to arou ...
" 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 Dennis MacAlistair Ritchie (September 9, 1941 – October 12, 2011) was an American computer scientist. He is most well-known for creating the C programming language and, with long-time colleague Ken Thompson, the Unix operating system and B p ...
: ''"So fsck was originally called something else"'' :Question: ''"What was it called?"'' :Dennis Ritchie: ''"Well, the second letter was different"'' "Go fsck yourself", is occasionally used online as an injunction to a person to go and correct their issue (attitude, ignorance of the subject matter, etc.) - in the same way that running fsck involves fixing fundamental errors.


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 Raid, RAID or Raids may refer to: Attack * Raid (military), a sudden attack behind the enemy's lines without the intention of holding ground * Corporate raid, a type of hostile takeover in business * Panty raid, a prankish raid by male college ...
device: fsck -t jfs /dev/md0


See also

*
List of Unix commands This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems. List See also * List of ...
*
List of file systems The following lists identify, characterize, and link to more thorough information on Computer file systems. Many older operating systems support only their one "native" file system, which does not bear any name apart from the name of the operating ...
*
e2fsprogs e2fsprogs (sometimes called the e2fs programs) is a set of utilities for maintaining the ext2, ext3 and ext4 file systems. Since those file systems are often the default for Linux distributions, it is commonly considered to be essential software. ...
, which includes the e2fsck utility, standard on many Linux distributions * scrub, Oracle Solaris ZFS file system checking utility


References


External links


man fsckChecking and Repairing File system with fsckThe many faces of fsck
{{Unix commands Computer file systems Hard disk software Unix file system-related software