Use it when configuring, checking or troubleshooting Filesystem Repair in Filesystems.
Filesystem Repair
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.
1. Repair unmounted (or read-only) filesystems.
2. Run dry-run first.
3. Back up or image the device before major repair.
4. Repairs can lose data (lost+found).
5. Find the cause (disk, RAM, power).
unmount → check → repair → verify
Context & applicabilityCommon mistakes · platform/version boundaries
A repair tool reporting success shows it completed its consistency algorithm, but it does not show every user file, application transaction or underlying device is healthy.
Suspicious evidence: repair is run repeatedly while device errors continue, forced options are used without recovery copies, filesystem stays read-only, or tool success is accepted without data/workload verification.
Operational reference
Fast context before you go deeper.
fsck -n <device>Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
symptom/error → evidence capture → lower-layer health check → recovery-point decision → filesystem check/repair → mount → data/application verification
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.
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.
- Repair ≠ restore.
- Repair success ≠ all file contents correct.
- Filesystem error ≠ purely filesystem root cause.
- Forced repair ≠ first troubleshooting step.
fsck -n /dev/<dev>— dry runxfs_repair -n /dev/<dev>— XFS dry runchkdsk D: /f— Windows repair
ReferenceImportant terms & boundaries2 sections · depth on demand
Namespace and consistency
A repair tool reporting success shows it completed its consistency algorithm, but it does not show every user file, application transaction or underlying device is healthy.
In depth
Repair tools work offline (unmounted or read-only) and can lose data if run on failing hardware — image the disk first when the data matters.
| Filesystem | Check | Repair |
|---|---|---|
| ext4 | e2fsck -n /dev/X | e2fsck -fy /dev/X |
| XFS | xfs_repair -n /dev/X | xfs_repair /dev/X (mount first to replay log) |
| Btrfs | btrfs check --readonly /dev/X | btrfs scrub; --repair only on expert advice |
| NTFS | chkdsk C: /scan | chkdsk C: /f or Repair-Volume -OfflineScanAndFix |
| ZFS | zpool scrub | Self-heals; restore files listed as permanent errors |
ddrescue /dev/sdb /mnt/rescue/sdb.img /mnt/rescue/sdb.map # image a failing disk first
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Filesystems → Filesystem Repair. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.kernel.org/filesystems/index.html · confidence 94%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.
Quick lookup tables
Filesystems → Filesystem Repair filesystem map
Fast namespace, metadata, capacity, attachment and verification boundaries for Filesystems → Filesystem Repair.
| 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 |