Practical steps to check and repair Linux filesystems safely with fsck. 16.11.2025 | reading time: 3 min A filesystem can fail at the worst time; use `fsck` to inspect and repair filesystem metadata from the shell and recover a partition without guessing. Quick preflight Stop and prepare: unmount the filesystem when possible, make a block-level backup if data matters, then run a non-destructive check with `fsck -n` to see what would change; for the root filesystem boot a rescue image or use the initramfs so `fsck` can run unmounted. Hands-on example Do this on a test device first; unmount and run `fsck` and accept fixes if they are reasonable: ``` $ sudo umount /dev/sdb1 $ sudo fsck -f /dev/sdb1 fsck from util-linux 2.34 e2fsck 1.45.5 (07-Jan-2020) /dev/sdb1: Inodes that were part of a corrupted orphan list found. Pass 1: Checking inodes, blocks, and sizes Inode 1234 extent tree (at level 1) could be narrower. Fix<y>? y /dev/sdb1: ***** FILE SYSTEM WAS MODIFIED ***** /dev/sdb1: 12345/131072 files, 543210/524288 blocks ``` If problems persist, boot from live media and run the same commands against the offline device. Options to know Key switches save time and risk: `-n` for no changes, `-y` to answer yes to prompts, `-f` to force a full check, `-A` to walk fstab, `-t` to limit types, `-N` to show actions without running, and `-V` for verbose output; remember that journaling filesystems often recover at mount, and never run a repair on a mounted writable filesystem unless the tool explicitly allows it. Complementary recovery tools Use filesystem-specific utilities when fsck is a wrapper: `e2fsck` for ext variants, `xfs_repair` for XFS (do not run fsck on XFS), and `btrfs check` or `btrfs scrub` for Btrfs; combine these with `smartctl` for disk health checks and `tune2fs` to configure periodic checks. Final thought Practice the workflow on non-critical devices, document the fixes applied, and prefer prevention through monitoring and backups; expand this skillset and consider formal study for certification with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem utilities storage troubleshooting boot-process