Disk errors in Linux can reflect drive read failures or filesystem damage. Disk-error checks distinguish these causes before deciding whether further scanning is appropriate, so recoverable data takes priority over a lengthy scan.
Storage faults can appear at more than one layer. Kernel messages show read and write failures seen by the operating system, smartctl reports firmware health when the disk or controller exposes S.M.A.R.T. data, and a read-only filesystem check examines metadata on the affected volume. A passing firmware health summary does not rule out read failures reported by the kernel.
Whole-disk checks and filesystem checks do not use the same device node. Firmware health belongs to the whole disk, while a metadata check belongs to the unmounted filesystem device. The metadata check here assumes an ext4 volume because XFS and Btrfs use separate checkers; USB bridges, RAID controllers, and virtual disks may hide firmware health information.
Steps to check disk errors in Linux:
- List the whole disk and filesystem device names. Example output:
$ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sdb `-sdb1 ext4 1.0 data 064e84d3-b7e4-45d0-89ba-6b28df345687 72G 54% /srv/data
smartctl takes the whole disk such as /dev/sdb or /dev/nvme0n1, while fsck and the optional surface scan take the filesystem device such as /dev/sdb1. The device names and mount point used here must match the affected filesystem on your system.
- Review recent kernel warning and error messages before checking the filesystem metadata. Example output:
$ sudo dmesg -T --level=err,warn [Mon Apr 13 09:21:07 2026] blk_update_request: I/O error, dev sdb, sector 4128760 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0 [Mon Apr 13 09:21:07 2026] Buffer I/O error on dev sdb1, logical block 515840, async page read
Lines that mention the affected disk or filesystem matter most, especially I/O error, Buffer I/O error, and filesystem-specific errors such as EXT4-fs. On systemd hosts, journalctl -k -p warning..alert -b shows the same class of kernel messages for the current boot.
- Check the disk firmware health summary on the whole disk device. Example output:
$ sudo smartctl -H -A /dev/sdb ##### snipped ##### === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED ID# ATTRIBUTE_NAME VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 5 Reallocated_Sector_Ct 100 100 010 Pre-fail Always - 0 197 Current_Pending_Sector 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 100 100 000 Old_age Offline - 0
The health summary comes from the whole disk, not the partition. Attribute names and meanings depend on the drive; PASSED is not proof that every sector is readable. If an adapter hides health information, the host or controller layer may be needed.
Related: How to check disk health in Linux - Stop further scanning if the results indicate failing media.
Repeated I/O error messages for the affected device, reads that stall or fail, failing firmware health, or pending or uncorrectable sectors are reasons to preserve data before running fsck, a surface scan, or a long self-test. Read-only checks still read the disk and can consume the remaining time in which data is recoverable. If these signs are present, stop normal use and prioritize a recovery image or clone onto healthy storage with a recovery tool such as GNU ddrescue; filesystem checks and repairs belong on the copy. If the disk clicks, disappears repeatedly, or holds irreplaceable data, stop accessing it and consider professional recovery. A PASSED health summary does not override read failures.
- Unmount the affected filesystem before checking its metadata.
Unmounting interrupts applications using the volume. If it is the root filesystem, a boot volume, or a busy production mount that cannot be unmounted normally, continue from rescue or live media instead of forcing a check on a mounted filesystem.
$ sudo umount /srv/data
- Confirm that the affected filesystem has no remaining mount entries.
$ findmnt --source /dev/sdb1
No output with exit status 1 means no matching mount was found in the current mount namespace. Any listed mount means the filesystem is still mounted; do not continue until it is unmounted everywhere, including other containers or mount namespaces that use it.
- Run a read-only metadata check against the affected ext4 filesystem.
$ sudo fsck -f -n /dev/sdb1 fsck from util-linux 2.41.3 e2fsck 1.47.2 (1-Jan-2025) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdb1: 12/16384 files (8.3% non-contiguous), 2097/16384 blocks
-f forces a full metadata check and -n keeps the ext4 check read-only. Exit status 0 means no errors were found; 4 means filesystem errors remain uncorrected, and 8 means an operational error. A report that journal recovery was skipped is not an all-clear. For XFS, use xfs_repair -n, and for Btrfs, use btrfs check --readonly instead of forcing a generic fsck run.
- Run an optional read-only surface scan only on unmounted media with no signs of read failure.
A full scan can take hours and is not a recovery step. If important data is not backed up, preserve it before this optional scan. If read errors or device dropouts appear during any check, stop the check and return to data preservation instead of repeating it. Never use -w on a device containing data because it overwrites the target with test patterns; -n is also a write test.
$ sudo badblocks -sv /dev/sdb1 Checking blocks 0 to 65535 Checking for bad blocks (read-only test): done Pass completed, 0 bad blocks found. (0/0/0 errors)
0 bad blocks found means the scanned range returned no read errors during this pass. A filesystem check reporting no errors plus this result means neither check detected a problem; it does not prove every file's contents are intact or guarantee future disk health. Any bad blocks are a reason to preserve data and investigate the drive before returning it to service. If the filesystem checker reports metadata damage on readable media, the repair procedure is a separate next step.
Related: How to fix disk errors in Linux
Related: How to mount a disk or partition in Linux