October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Check a Linux Filesystem for Errors With fsck

Use fsck safely by identifying the filesystem and target first, unmounting it, choosing its filesystem-specific checker, and understanding the result.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Identify the filesystem and device first, then use the checker designed for that filesystem while it is unmounted. fsck is a dispatcher, not one universal repair tool: it calls a filesystem-specific program, and the meaning of options can vary. For ext2, ext3, and ext4, that checker is e2fsck; XFS requires a different workflow.

1. Identify the filesystem and target device

Before checking anything, establish both the filesystem type and the device you intend to check. The generic fsck interface accepts a device, mount point, filesystem label, or UUID, then dispatches to the matching fsck.fstype checker available on the system. A mount point or label may be convenient, but verify that it resolves to the intended filesystem rather than assuming a disk name refers to the right volume.

Options are not fully standardized across filesystem-specific checkers. Once you know the type, consult the manual for that checker and follow its instructions rather than assuming a flag behaves identically for every filesystem.

2. Make sure the filesystem is unmounted

Do not run a repair check against a mounted filesystem. The e2fsck manual warns that “In general, it is not safe to run e2fsck on mounted file systems.” Even its limited read-only -n mode can produce invalid results when the filesystem is mounted. If the target is mounted, arrange to take it offline and confirm it is unmounted before proceeding.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Checking the root filesystem

The running system normally uses its root filesystem, so a repair check must be performed from an offline environment, such as recovery media or another boot environment. Confirm that the target filesystem is not mounted there before starting the check; do not accept a prompt to check a mounted filesystem.

3. Choose the checker and whether to inspect or repair

For ext2, ext3, and ext4

Use e2fsck for ext-family filesystems. Its modes have different consequences:

  • e2fsck -n DEVICE opens the filesystem read-only and answers “no” to repair prompts. This is an inspection-oriented mode, not a guarantee of reliable results on a mounted filesystem.
  • e2fsck -p DEVICE automatically applies repairs that the program considers safe to make without human intervention.
  • e2fsck -y DEVICE answers yes to every question. It is a repair choice, not a neutral inspection mode, because it authorizes all proposed repairs without asking you to decide individually.

Replace DEVICE with the verified target device. Run the selected mode only when the filesystem is unmounted, and use the e2fsck manual for the complete behavior and any prompts specific to your situation.

For XFS

Do not treat a successful fsck.xfs run as evidence that XFS consistency was checked: that front end exits successfully without performing a consistency check. The fsck.xfs manual directs users to xfs_repair for consistency checking or repair. Follow the XFS-specific manual and workflow rather than applying ext-family e2fsck options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For other filesystem types

Use the checker selected for the identified filesystem and consult its manual. The generic fsck command does not make checker behavior or options uniform across filesystem types.

4. Understand what happens after an unclean shutdown

An unclean shutdown does not automatically mean a full manual repair is required. On ext3 and ext4, journal replay after an unclean shutdown can often complete and mark the filesystem clean. If there are no further error indications, do not assume that a separate manual repair is necessary; if errors are reported, use the filesystem-specific guidance and keep the filesystem offline for repair.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

5. Interpret the fsck exit status

The generic fsck command uses an exit status to report the outcome. The documented statuses include:

Exit status Meaning
0 No errors
1 Filesystem errors corrected
2 System should be rebooted
4 Filesystem errors remain uncorrected
8 Operational error

Other documented statuses cover usage errors, cancellation, and shared-library errors. When more than one checker status is returned, the generic interface combines statuses bitwise, so the result may represent multiple conditions rather than a single one. Check the manual and the checker’s output when interpreting a result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.