Filesystem Repair
Cheat sheet · https://pcornel.dk/topic.php?topic=3964
Answer
Repair tools reconcile filesystem metadata according to implementation-specific rules. Because repair may discard or rewrite metadata to regain structural consistency, it should follow evidence capture, backup/recovery evaluation and appropriate offline or maintenance-state requirements.
Remember
- Repair ≠ restore.
- Repair success ≠ all file contents correct.
- Filesystem error ≠ purely filesystem root cause.
- Forced repair ≠ first troubleshooting step.
First checks
fsck -n /dev/<dev>— dry runxfs_repair -n /dev/<dev>— XFS dry runchkdsk D: /f— Windows repair
Commands
fsck -n <device>- Operational command for Perform a read-only filesystem consistency check. Focus fields: filesystem type, superblock/che…
zpool scrub
Verify in this order
unmount → check → repair → verify
Where it usually breaks
First mismatch in media/provider → controller/pool → logical object → path/protocol → filesystem/share/object namespace → consumer workload; preserve identity/pre-state before mutation.
Filesystems → Filesystem Repair filesystem map
| Filesystem boundary | What to verify | Proof limit |
|---|---|---|
| Identity / attachment | Filesystem type, source/backing object, mount/attachment target and effective options | Presence or mount state alone does not prove consistency or lower-layer health |
| Capacity / metadata | Data space, metadata/inodes, quotas/reservations and filesystem state | Free bytes at one layer do not prove allocation can succeed end to end |
| Failure boundary | A repair tool reporting success proves it completed its consistency algorithm; it does not prove every user file, application transaction or underlying device is healthy. | Correlate filesystem evidence with the backing volume/path/backend before repair |
| Acceptance | Healthy evidence: lower storage is stable, repair runs in a supported state, consistency checks pass afterward, representative data is readable and the original workload plus recovery protection are verified. | Close only after the original path/workload and read-back check succeeds |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3964