FSCK(8)
FSCK ๐ (section 8, System Administration)
okay bestie, sit down, hydrate, because we're about to talk about fsck โ the check-and-repair-a-Linux-filesystem girlie ๐
. she's section 8 of the system administration manual, she's iconic, and she is literally the reason your machine boots. no cap.
โจ NAME โจ
fsck โ check and repair a Linux filesystem ๐ฉบ๐
๐ธ SYNOPSIS ๐ธ
fsck [-lsAVRTMNP] [-r [fd]] [-C [fd]] [-t fstype] [filesystem...] [--]
[fs-specific-options]
๐ฆ DESCRIPTION ๐ฆ
so basically, fsck is used to check and optionally repair one or more Linux filesystems. that's the whole vibe. ๐ซถ
and filesystem โ the thing you pass her โ can be like, a few different things:
- a device name, e.g.
/dev/hdc1,/dev/sdb2 - a mount point, e.g.
/,/usr,/home - a filesystem label or UUID specifier, e.g.
UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bdorLABEL=root
normally, the fsck program will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of them. multitasking queen ๐โจ
if no filesystems are specified on the command line, and the -A option is not specified, fsck will default to checking filesystems in /etc/fstab serially. this is equivalent to the -As options. (yes bestie, -As. it's giving "the defaults said what they said" ๐)
๐ the exit status situation ๐
the exit status returned by fsck is the sum of the following conditions:
0โ no errors ๐1โ filesystem errors corrected โจ2โ system should be rebooted ๐4โ filesystem errors left uncorrected ๐ญ8โ operational error ๐16โ usage or syntax error ๐32โ checking canceled by user request ๐128โ shared-library error ๐ซ
and when multiple filesystems are checked, the exit status returned is the bit-wise OR of the exit statuses for each filesystem that is checked. math girlie behavior, we love her for it ๐
๐ง the tea: what fsck actually IS ๐ง
in actuality, fsck is simply a front-end for the various filesystem checkers (fsck.fstype) available under Linux. she's not doing the work herself, she's the manager. main character energy, honestly.
the filesystem-specific checker is searched for in the PATH environment variable. if the PATH is undefined then fallback to /sbin. so like, know where your helpers live, bestie ๐
please see the filesystem-specific checker manual pages for further details. (go read those too, they're the deep lore ๐)
๐ OPTIONS ๐
-lโ create an exclusiveflock(2)lock file (/run/fsck/<diskname>.lock) for whole-disk device. this option can be used with one device only (which means-Aand-lare mutually exclusive โ pick a lane, babe ๐ซ). this option is recommended when morefsckinstances are executed in the same time. the option is ignored when used for multiple devices or for non-rotating disks. and listen:fsckdoes not lock underlying devices when executed to check stacked devices (e.g. MD or DM) โ this feature is not implemented yet. so yeah, that's a known gap, not a you problem ๐-r [fd]โ report certain statistics for eachfsckwhen it completes. these statistics include the exit status, the maximum run set size (in kilobytes), the elapsed all-clock time and the user and system CPU time used by thefsckrun. for example:
/dev/sda1: status 0, rss 92828, real 4.002804, user 2.677592, sys
0.86186
GUI front-ends may specify a file descriptor fd, in which case the progress bar information will be sent to that file descriptor in a machine parsable format. for example:
/dev/sda1 0 92828 4.002804 2.677592 0.86186
-sโ serializefsckoperations. this is a good idea if you are checking multiple filesystems and the checkers are in an interactive mode. (note:e2fsck(8)runs in an interactive mode by default. to makee2fsck(8)run in a non-interactive mode, you must either specify the-por-aoption, if you wish for errors to be corrected automatically, or the-noption if you do not.) okay so lowkey this one is the "no talking over each other" flag ๐-t fslistโ specifies the type(s) of filesystem to be checked. when the-Aflag is specified, only filesystems that match fslist are checked. the fslist parameter is a comma-separated list of filesystems and options specifiers. all of the filesystems in this comma-separated list may be prefixed by a negation operatornoor!, which requests that only those filesystems not listed in fslist will be checked. if none of the filesystems in fslist is prefixed by a negation operator, then only those listed filesystems will be checked.
options specifiers may be included in the comma-separated fslist. they must have the format opts=fs-option. if an options specifier is present, then only filesystems which contain fs-option in their mount options field of /etc/fstab will be checked. if the options specifier is prefixed by a negation operator, then only those filesystems that do not have fs-option in their mount options field of /etc/fstab will be checked.
for example, if opts=ro appears in fslist, then only filesystems listed in /etc/fstab with the ro option will be checked.
for compatibility with Mandrake distributions whose boot scripts depend upon an unauthorized UI change to the fsck program, if a filesystem type of loop is found in fslist, it is treated as if opts=loop were specified as an argument to the -t option. (a little historical tea for you โโจ)
normally, the filesystem type is deduced by searching for filesys in the /etc/fstab file and using the corresponding entry. if the type cannot be deduced, and there is only a single filesystem given as an argument to the -t option, fsck will use the specified filesystem type. if this type is not available, then the default filesystem type (currently ext2) is used. default queen, stuck in her era ๐
-Aโ walk through the/etc/fstabfile and try to check all filesystems in one run. this option is typically used from the/etc/rcsystem initialization file, instead of multiple commands for checking a single filesystem.
the root filesystem will be checked first unless the -P option is specified (see below). after that, filesystems will be checked in the order specified by the fs_passno (the sixth) field in the /etc/fstab file. filesystems with a fs_passno value of 0 are skipped and are not checked at all. filesystems with a fs_passno value of greater than zero will be checked in order, with filesystems with the lowest fs_passno number being checked first. if there are multiple filesystems with the same pass number, fsck will attempt to check them in parallel, although it will avoid running multiple filesystem checks on the same physical disk. efficiency slay โก
fsck does not check stacked devices (RAIDs, dm-crypt, ...) in parallel with any other device. see below for FSCK_FORCE_ALL_PARALLEL setting. the /sys filesystem is used to determine dependencies between devices. (she checks the receipts in /sys, iykyk ๐งพ)
hence, a very common configuration in /etc/fstab files is to set the root filesystem to have a fs_passno value of 1 and to set all other filesystems to have a fs_passno value of 2. this will allow fsck to automatically run filesystem checkers in parallel if it is advantageous to do so. system administrators might choose not to use this configuration if they need to avoid multiple filesystem checks running in parallel for some reason โ for example, if the machine in question is short on memory so that excessive paging is a concern. know your machine's limits, bestie ๐ซถ
fsck normally does not check whether the device actually exists before calling a filesystem specific checker. therefore non-existing devices may cause the system to enter filesystem repair mode during boot if the filesystem specific checker returns a fatal error. the /etc/fstab mount option nofail may be used to have fsck skip non-existing devices. fsck also skips non-existing devices that have the special filesystem type auto. okay so like, nofail is your bestie here, don't forget her ๐
-C [fd]โ display completion/progress bars for those filesystem checkers (currently only forext[234]) which support them.fsckwill manage the filesystem checkers so that only one of them will display a progress bar at a time. no cluttered screen, we keep it cute ๐ GUI front-ends may specify a file descriptor fd, in which case the progress bar information will be sent to that file descriptor.-Mโ do not check mounted filesystems and return an exit status of0for mounted filesystems. minding her own business, respectfully โ-Nโ don't execute, just show what would be done. window shopping, essentially ๐๏ธ-Pโ when the-Aflag is set, check the root filesystem in parallel with the other filesystems. > this is not the safest thing in the world to do, since if the root filesystem is in doubt things like thee2fsck(8)executable might be corrupted! ๐ญ this option is mainly provided for those sysadmins who don't want to repartition the root filesystem to be small and compact (which is really the right solution). so likeโฆ she's telling you the correct answer and also handing you the risky option. your call, babe ๐-Rโ when checking all filesystems with the-Aflag, skip the root filesystem. (this is useful in case the root filesystem has already been mounted read-write.) already handled, moving on โจ-Tโ don't show the title on startup. minimalism era ๐ฟ-Vโ produce verbose output, including all filesystem-specific commands that are executed. she will narrate everything. every single thing. ๐ข-?,--helpโ display help text and exit. ๐--versionโ display version and exit. ๐ท๏ธ
๐ FILESYSTEM SPECIFIC OPTIONS ๐
options which are not understood by fsck are passed to the filesystem-specific checker! that's not a bug bestie, that's the design ๐
these options must not take arguments, as there is no way for fsck to be able to properly guess which options take arguments and which don't. she's not a mind reader ๐ญ
options and arguments which follow the -- are treated as filesystem-specific options to be passed to the filesystem-specific checker.
please note that fsck is not designed to pass arbitrarily complicated options to filesystem-specific checkers. if you're doing something complicated, please just execute the filesystem-specific checker directly. if you pass fsck some horribly complicated options and arguments, and it doesn't do what you expect, don't bother reporting it as a bug. you're almost certainly doing something that you shouldn't be doing with fsck. options to different filesystem-specific fsck's are not standardized. so likeโฆ read the room, and read the specific checker's man page ๐ซถโจ
๐ธ ENVIRONMENT ๐ธ
okay so bestie, <pink>fsck</pink> is lowkey listening to your environment the whole time โ here's every variable that changes its whole vibe:
FSCK_FORCE_ALL_PARALLELโ set this andfsckwill try to check all the filesystems you told it about in parallel, even if they look like they're sitting on the same device. (super useful for RAID setups or those fancy high-end storage systems, like the ones sold by companies such as IBM or EMC.) heads up though: thefs_passnovalue is still used. no cap.FSCK_MAX_INSTโ this one caps how many filesystem checkers can be running at the same time. it's giving "my server has 400 disks and I would like it to not explode." systems with a ton of disks use this sofsckdoesn't spawn a million checkers at once and overload the CPU and memory available. ๐ซ if you set it to zero, then an unlimited number of processes can be spawned โ and that's currently the default, but future versions offsckmay try to auto-figure out how many checks can run by gathering accounting data from the operating system. ๐PATHโ thePATHenvironment variable is used to find filesystem checkers. that's it, that's the whole job, but it's an important one. ๐FSTAB_FILEโ lets the system administrator override the standard location of the/etc/fstabfile. also iconic for developers who are testingfsckand don't wanna mess with the real one. ๐LIBBLKID_DEBUG=allโ enableslibblkiddebug output. ๐LIBMOUNT_DEBUG=allโ enableslibmountdebug output. ๐
๐๏ธ FILES ๐๏ธ
/etc/fstab
๐ NOTES ๐
okay so this is a lil plot twist: during boot, systemd does not invoke fsck -A. instead, it schedules the activation of mounts individually, taking into account dependencies on backing devices, networking, and other factors. so because of all that, fsck gets called individually for each device instead of in one big -A sweep. the more you know ๐ซ
๐ AUTHORS ๐
Theodore Ts'o <tytso@mit.edu>, Karel Zak <kzak@redhat.com>
๐ SEE ALSO ๐
fstab(5), mkfs(8), fsck.ext2(8) or fsck.ext3(8) or e2fsck(8), fsck.cramfs(8), fsck.jfs(8), fsck.nfs(8), fsck.minix(8), fsck.msdos(8), fsck.vfat(8), fsck.xfs(8), reiserfsck(8)
๐ REPORTING BUGS ๐
found a bug? don't suffer in silence bestie ๐ญ for bug reports, use the issue tracker: <https://github.com/util-linux/util-linux/issues>.
๐ฆ AVAILABILITY ๐ฆ
The fsck command is part of the util-linux package, which can be downloaded from the Linux Kernel Archive: <https://www.kernel.org/pub/linux/utils/util-linux/>.
and that's the whole page, bestie!! ๐ซถ this one is util-linux 2.42.4, dated 2026-09-21, and it lives in FSCK(8). go forth and check your filesystems, you absolute legend ๐โจ๐
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms