Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Fsck
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==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 {{#tag:code|fsck.''type''}} (Linux) or {{#tag:code|fsck_''type''}} (BSD, macOS) program for each type.<ref name=Linux/><ref name=FreeBSD>{{man|8|fsck|FreeBSD}} "It was reimplemented as a filesystem independent wrapper in NetBSD 1.3 and first appeared in FreeBSD 5.0."</ref> 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 and found#Computing|"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. === Boot time === 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" {{code|-p}} mode that only fixes innocuous issues commonly found after an unclean shutdown (i.e. crash, power fail).<ref name=FreeBSD/> 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.<ref>{{man|8|tune2fs|Linux}}</ref> Some modern file systems do not require fsck to be at boot after an unclean shutdown. Some examples are: * [[XFS]], a [[journaling file system]]. It has a dummy fsck which does nothing<ref>{{man|8|fsck.xfs|Linux}}: "XFS is a journaling filesystem and performs recovery at mount(8) time if necessary"</ref> and an actual <code>xfs_repair</code> tool to be run when problems are suspected. * [[Unix File System|UFS2]] file system in [[FreeBSD]], which can delay the check to background if [[soft updates]] are enabled.<ref>{{man|8|fsck_ffs|FreeBSD}}</ref> As a result, it is usually not necessary to wait for fsck to finish before accessing the disk. This design is reflected by the {{code|-F}} flag used at boot.<ref name=FreeBSD/> * [[ZFS]] and [[Btrfs]], two full [[copy-on-write]] file systems. They avoid in-place changes to assure levels of consistency similar to a journal. They also provide a dummy fsck.<ref>{{man|8|fsck.btrfs|Linux}}, : "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."</ref> <code>btrfs-check</code> is still available to check for suspected problems in filesystem structure (e.g. when a software bug or hardware issue is suspected). 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.<ref>{{cite web |last1=Swearingen |first1=Cindy |title=Scheduled Pool Scrubs in Oracle Solaris ZFS |url=https://blogs.oracle.com/solaris/post/scheduled-pool-scrubs-in-oracle-solaris-zfs}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Fsck
(section)
Add topic