e2fsck

Check ext2/3/4 filesystems

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
e2fsck -n <device>Read-only check first
ddrescue <device> image.img mapImage a failing disk first
What it does

Checks and repairs ext filesystems. Always run on unmounted devices.

Common flags
FlagMeaning
-nRead-only check
-pAutomatic safe repairs
-fForce check
-yAnswer yes to all repairs⚠ May delete or truncate damaged files.
Examples
e2fsck -n /dev/sdb1Read-only check · explain & risk-check →
e2fsck -f /dev/sdb1Force a check · explain & risk-check →
Related
fsck smartctl mount
Open the full explainer →More in Disks & Filesystems

Reference text is hand-written and may be incomplete — check man e2fsck for your version. Test destructive commands on a non-production system first.