Fsck
Encyclopedia
The system utility fsck (for "file system check") is a tool for checking the consistency of a file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

 in Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 and Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 operating systems such as Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

.

Use

Generally, fsck is run automatically at boot time, either when the operating system detects that a file system is in an inconsistent state, indicating a non-graceful shutdown, such as a crash
Crash (computing)
A crash in computing is a condition where a computer or a program, either an application or part of the operating system, ceases to function properly, often exiting after encountering errors. Often the offending program may appear to freeze or hang until a crash reporting service documents...

 or power loss; or periodically to prevent small, undetected inconsistencies becoming exacerbated. As the command must be tailored specifically to the design of the file system, the exact behavior of various fsck implementations will vary. Typically, 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.

A system administrator
System administrator
A system administrator, IT systems administrator, systems administrator, or sysadmin is a person employed to maintain and operate a computer system and/or network...

 can also run fsck manually if there is believed to be 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
Journaling file system
A journaling file system is a file system that keeps track of the changes that will be made in a journal before committing them to the main 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
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...

 has background fsck, so it is usually not necessary to wait for fsck to finish before accessing the disk.

The Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 equivalent programs are CHKDSK
CHKDSK
CHKDSK is a command on computers running DOS, OS/2 and Microsoft Windows operating systems that displays the file system integrity status of hard disks and floppy disk and can fix logical file system errors. It is similar to the fsck command in Unix.The command is implemented as an executable...

 and SCANDISK
SCANDISK
SCANDISK or ScanDisk is a utility in MS-DOS and Microsoft Windows systems which checks and repairs file systems and bad clusters on the hard drive. It was introduced in MS-DOS version 6.2...

.

Use as profanity

Before the rise of journaling file system
Journaling file system
A journaling file system is a file system that keeps track of the changes that will be made in a journal before committing them to the main file system...

s, it was common for an improperly shut-down Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 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
Minced oath
A minced oath is an expression based on a profanity or a taboo term that has been altered to reduce the objectionable characteristics.Many languages have such expressions...

.

It is unclear whether this usage was cause or effect, as it has been anecdotally reported that Dennis Ritchie
Dennis Ritchie
Dennis MacAlistair Ritchie , was an American computer scientist who "helped shape the digital era." He created the C programming language and, with long-time colleague Ken Thompson, the UNIX operating system...

 has claimed "The second letter was originally different."

Example

The following example checks the file system on the first partition of the second hard disk on a Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 system:

fsck /dev/sdb1

See also

  • List of Unix programs
  • List of file systems
  • e2fsprogs
    E2fsprogs
    e2fsprogs 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
    Scrub
    Scrub or Scrubber may refer to:* Scrub, low shrub and grass characteristic of scrubland* Scrubs , worn by medical staff* Scrubs , an American television program...

    Oracle Solaris ZFS filesystem checking utility

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK