Pcornel
Browse topics
Options
Recent
Favorites
Storage · Technical reference

Filesystem Corruption

Direct answer

Filesystem integrity depends on successful block I/O plus coherent filesystem metadata. Diagnose read-only and non-destructive checks first, then prove the backing device/path is stable before repair.

When to use this

Use it when the symptom is “Filesystem Corruption”: work through the layers in order and stop at the first one that fails.

First 30 seconds

1. Corruption: check underlying disks/RAM first.

2. Image the device before repair if data is valuable.

3. Run repair offline.

4. Restore damaged data from backups.

5. Find the root cause.

Operational verification

corruption → device check → repair/restore

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Failure and recovery traps

A filesystem consistency error shows a filesystem structure is inconsistent; it does not by itself identify whether the cause was power loss, software, memory, media or transport.

Suspicious evidence includes repeated metadata errors after repair, new I/O errors, checksum mismatches, remount-read-only events or corruption recurring on the same blocks/device.

Platform / version applicability
Storage architecture and operations
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformStorage architecture and operations · Linux filesystem tools
Key commandfsck -n /dev/<device>
Scope / prerequisiteUse it when the symptom is “Filesystem Corruption”: work through the layers in order and stop at the first one that fai…
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence1
On this pageJump to a specific section
Storage command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

Application symptom → filesystem metadata/data structures → block device/volume → path/controller → media/backend → read-only check → repair → read-back

Healthy evidence shows clean filesystem-specific verification, stable backing I/O and successful application/file read-back after recovery.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Filesystem error message ≠ failed disk automatically.
  • Journal replay ≠ full integrity verification.
  • Repair success ≠ user-file contents are correct.
  • Running destructive repair on an unstable device can worsen recoverability.
Key checks
  • dmesg | grep -i -e error -e corrupt — errors
  • fsck -n / xfs_repair -n — dry-run check
  • zpool status -v — ZFS damaged files
ReferenceImportant terms & boundaries3 sections · depth on demand

Scope and what the checks show

A filesystem consistency error shows a filesystem structure is inconsistent; it does not by itself identify whether the cause was power loss, software, memory, media or transport.

In depth

Check without changing first

e2fsck(8) is the checker for ext2/3/4. The manual says it is generally unsafe to run it on a mounted file system; the read-only -n mode is the only exception, and even then the results are not valid for a mounted system. Unmount, or boot a rescue system.

# umount /srv
# e2fsck -fn /dev/sdb1
e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Inode 393218 has illegal block(s).  Clear? no
...
/dev/sdb1: ********** WARNING: Filesystem still has errors **********
# echo $?
4

Options

OptionUse
-nRead-only, answer "no" to everything — assessment
-fForce a check even if the file system looks clean
-pAutomatically fix what is safe to fix
-yAnswer "yes" to everything — only after a backup/image
-b <superblock>Use a backup superblock when the primary is damaged

Exit codes are a bit mask

BitMeaning
0No errors
1Errors corrected
2Errors corrected, reboot required
4Errors left uncorrected
8Operational error

Safe order

1. Find out why the corruption happened (I/O errors, power loss, host crash) — fixing metadata on a failing disk makes it worse.

2. Image the device (ddrescue) if the data matters and the disk is suspect.

3. e2fsck -fn, then e2fsck -fp or -fy on the image or the device.

4. Look in lost+found for recovered files.

5. Restore from backup when the check removes more than it saves.

*The e2fsck transcript and exit status demonstrate a read-only integrity check; no real volume was scanned.*

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Method

Filesystem corruption is usually a symptom: find the cause before repairing.

1. Stop writes (unmount or remount read-only) to avoid spreading damage.

2. Check hardware: dmesg I/O errors, SMART, RAID status, memory (ECC errors in edac-util/rasdaemon).

3. Take an image or snapshot of the device if the data matters (ddrescue).

4. Run the filesystem's check in read-only mode first (e2fsck -n, xfs_repair -n, chkdsk /scan).

5. Repair, then compare against backups and restore damaged files.

Recurring corruption on a filesystem without checksums points to hardware, firmware, unclean shutdowns with volatile write caches, or two hosts mounting the same non-cluster filesystem.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docStorage architecture and operations current

Authoritative/upstream documentation reviewed for bounded claims in Storage Troubleshooting → Filesystem Corruption. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/block/index.html · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
filesystem corruptioncorrupt filesystemfsck repairfilesystem metadata error
Embedded reference data

Quick lookup tables

Storage Troubleshooting → Filesystem Corruption proof map

Fast scope, dependency, failure-boundary and acceptance checks for Storage Troubleshooting → Filesystem Corruption.

Troubleshooting boundaryWhat to verifyProof limit
Scope / identityExact workload, object/device identity, affected hosts and incident windowSymptom naming alone is not root-cause proof
Dependency pathApplication symptom → filesystem metadata/data structures → block device/volume → path/controller → media/backend → read-only check → repair → read-backHealthy adjacent layers do not prove end-to-end health
Failure boundaryA filesystem consistency error proves a filesystem structure is inconsistent; it does not by itself identify whether the cause was power loss, software, memory, media or transport.Correlate evidence for the same operation and timestamps
AcceptanceHealthy evidence shows clean filesystem-specific verification, stable backing I/O and successful application/file read-back after recovery.Close only after the original workload/recovery test and regression check
Confirmation

Confirm action

Continue?