Linuxlab

Disk integrity in Linux: fsck and smartctl

Updated July 3, 2026

fsck checks and repairs a filesystem, while smartctl reads the health of the disk itself from its SMART data.

Common cases

sudo umount /dev/sdb1      # unmount before checking
sudo fsck /dev/sdb1        # check and repair the filesystem
sudo fsck -n /dev/sdb1     # -n check only, change nothing
sudo smartctl -H /dev/sda  # an overall health verdict for the disk
sudo smartctl -a /dev/sda  # all SMART attributes

How it works: two different checks

These are about different layers. fsck (file system check) repairs the LOGIC of a filesystem: lost blocks, broken links, a count left inconsistent after a power cut. You run it only on an unmounted partition. On a mounted one you can corrupt the filesystem; usually the system runs fsck itself at boot if it spots a problem. smartctl looks at the HARDWARE: disks run their own SMART self-diagnostics (reallocated sector count, read errors, power-on hours). A rising reallocated-sector count is a sign the disk is dying and should be replaced before it fails.

In the book

This topic is covered in full in the chapter Advanced storage and data integrity.

See also

Mounting: mount, df and du, LVM: logical volumes.