whatis fsck
fsck
Also known as: filesystem check
The tool that checks a filesystem for inconsistencies and repairs them, typically run on an unmounted partition after a crash.
What Is fsck in Linux?
fsck is a front end that calls the right checker for each filesystem, such as e2fsck for ext4 or xfs_repair for XFS. Systemd runs it automatically at boot for filesystems with a non-zero pass number in fstab.
Never run a repair on a mounted read-write filesystem; boot from a live USB or use rescue mode. Btrfs and ZFS use their own scrub and check tools instead.
Example
sudo umount /dev/sdb1
sudo fsck -f /dev/sdb1 Learn more about fsck
- fsck: Checking and Repairing Linux Filesystems Never run it on a mounted filesystem. Beyond that one rule, here is how to force a check at boot, what the repair prompts actually mean, and when a filesystem problem is really a disk problem.
- Rescuing an Unbootable Linux System with chroot When Linux will not boot, a live USB plus chroot lets you enter the broken installation as if it were running: fix the bootloader, roll back a bad kernel, reset a password, and reinstall packages from inside.