Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Use  



1.1  Boot time  







2 History  





3 As an expletive  





4 Examples  





5 See also  





6 References  





7 External links  














fsck






العربية
Беларуская
Boarisch
Català
Čeština
Deutsch
Español
فارسی
Français

Italiano
עברית
Lombard

Norsk bokmål
Polski
Português
Română
Русский
Suomi
Türkçe
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


fsck
Operating systemUnix and Unix-like
TypeCommand

The system utility fsck (file system consistency check) is a tool for checking the consistency of a file systeminUnix and Unix-like operating systems, such as Linux, macOS, and FreeBSD.[1] The equivalent programs on MS-DOS and Microsoft Windows are CHKDSK, SFC, and SCANDISK.

Use[edit]

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 fsck.type (Linux) or fsck_type (BSD, macOS) program for each type.[1][2]

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.

Asystem 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.

Boot time[edit]

As boot time fsck is expected to run without user intervention, it generally defaults to not perform any destructive operations. This may be in the form of a read-only check (failing whenever issues are found), or more commonly, a "preen" -p mode that only fixes innocuous issues commonly found after an unclean shutdown (i.e. crash, power fail).[2]

ext2/3/4 offers an option to force a boot-time check after a specified number of mounts, so that periodic checking can be done.[3]

Some modern file systems do not require fsck to be at boot after an unclean shutdown. Some examples are:

Independent of checking the file system structure, modern file systems may offer a data scrubbing tool to check for silent corruption in stored data against a mirror or a checksum. Scrubs tend to be slow as they cover all data on a disk, but periodic runs can defend against data rot and help identify failing drives.[7]

History[edit]

fsck first appeared in 4.0BSD of 1980. It turned into its modern wrapper form in NetBSD 1.3 (1998). fsck is not defined by any extant standard,[2] but the primitive non-wrapper form is present in the 1995 draft Systems Management: File System and Scheduling Utilities (FSSU) from X/Open.[8]

As an expletive[edit]

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".[9] 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"[10][11]

That story has been confirmed by Rob Pike on the Mastodon social network on December 17, 2023:

Ted Kowalski, username frodo, may he rest in peace, was the original author, just down the hall from my office in Murray Hill, and his name for the program had a 'u' where there is now an 's'. Management made him change it for distribution, but they couldn't make him change his pronunciation.

— Rob Pike, [12]

"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[edit]

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[edit]

References[edit]

  1. ^ a b fsck(8) – Linux Programmer's Manual – Administration and Privileged Commands "In actuality, fsck is simply a front-end for the various filesystem checkers (fsck.fstype) available under Linux."
  • ^ a b c d fsck(8) – FreeBSD System Manager's Manual "It was reimplemented as a filesystem independent wrapper in NetBSD 1.3 and first appeared in FreeBSD 5.0."
  • ^ tune2fs(8) – Linux Programmer's Manual – Administration and Privileged Commands
  • ^ fsck.xfs(8) – Linux Programmer's Manual – Administration and Privileged Commands: "XFS is a journaling filesystem and performs recovery at mount(8) time if necessary"
  • ^ fsck_ffs(8) – FreeBSD System Manager's Manual
  • ^ fsck.btrfs(8) – Linux Programmer's Manual – Administration and Privileged Commands, : "do nothing, successfully" "Traditional filesystems need to run their respective fsck utility in case the filesystem was not unmounted cleanly and the log needs to be replayed before mount. This is not needed for BTRFS."
  • ^ Swearingen, Cindy. "Scheduled Pool Scrubs in Oracle Solaris ZFS".
  • ^ "Systems Management: File System and Scheduling Utilities (FSSU)" (PDF). opengroup.org. 1995. p. 18. Retrieved 8 April 2023.
  • ^ Raymond, Eric S (September 24, 1999). "fscking". The Jargon File. Archived from the original on 2009-01-03. fcking: /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?'
  • ^ Crosby, Matthew. "Report from Usenix". alt.sysadmin.recovery. Usenet. Retrieved 2016-02-20.
  • ^ "Mind Fsck". WikiWikiWeb. C2.
  • ^ Rob Pike, Rob Pike on Mastodon: the truth on fsck pronunciation and original naming, retrieved 2023-12-18
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Fsck&oldid=1214271086"

    Categories: 
    Computer file systems
    Hard disk software
    Unix file system-related software
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
     



    This page was last edited on 17 March 2024, at 23:10 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki