smartctl on Linux: Check Disk Health (SMART Attributes and Tests)

smartctl disk health linux - custom-smart-featured.png

smartctl reads a drive’s self-reported health — reallocated sectors, pending errors, and overall PASSED/FAILED. Admins search it after I/O errors in dmesg or before trusting an old disk in production.

Related: dmesg,
mount & fstab,
disk full.

Install smartmontools

Provides smartctl and optional smartd daemon for mail alerts.

bashDebian/Ubuntu
sudo apt install -y smartmontools
sudo smartctl --version
smartmontools
install

Health summary

Start with -H then full attributes -a (SATA/SAS) or NVMe log.

bashSATA
sudo smartctl -H /dev/sda
sudo smartctl -a /dev/sda | head -40
smartctl -a
PASSED

Run self-tests

Short test online; long test may take hours on large disks.

bashshort test
sudo smartctl -t short /dev/sda
sudo smartctl -l selftest /dev/sda
self-test
schedule

Act on failures

Back up immediately on FAILED or rising reallocated sectors; replace disk before RAID degrades further.

WarningSMART is predictive, not perfect — pair with backups and RAID monitoring.
replace disk
backup

Quick Reference

  • Quick health: smartctl -H /dev/sdX
  • Details: smartctl -a /dev/sdX
  • NVMe: smartctl -a /dev/nvme0

Related tutorials

Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.