Linux Storage

Check disk health with SMART on Linux

Catch failing drives before they take your data to hell.

12 min read Intermediate Updated 9 Jun 2026

Step-by-step guide

Work through each section in order. Stop when your issue is resolved — you do not need every step for every situation.

Warning

SMART is predictive, not prophetic — a PASSED status does not guarantee the disk survives tomorrow. Replace drives with rising reallocated or pending sectors before they take your data with them.

What you will achieve

Install smartmontools on Ubuntu or Debian, run SMART health checks on HDDs and SSDs, and interpret the attributes that signal imminent failure.

1) Install smartmontools

sudo apt update
sudo apt install smartmontools

2) Check if SMART is supported and enabled

sudo smartctl -i /dev/sda
sudo smartctl -i /dev/nvme0n1

Look for SMART support is: Enabled. USB adapters often hide SMART — results may be unavailable for external drives.

3) Overall health summary

sudo smartctl -H /dev/sda
sudo smartctl -H /dev/nvme0n1

PASSED or OK is good. FAILED means replace the drive now, not after lunch.

4) Full attribute report (HDD/SATA SSD)

sudo smartctl -a /dev/sda

Watch these attributes:

  • Reallocated_Sector_Ct — rising count means bad sectors swapped out
  • Current_Pending_Sector — sectors waiting to remap; investigate immediately
  • UDMA_CRC_Error_Count — often cable/port issue, not disk media
  • Power_On_Hours — age context for wear decisions

5) NVMe specific checks

sudo smartctl -a /dev/nvme0n1
sudo nvme smart-log /dev/nvme0n1   # if nvme-cli installed

Monitor Percentage Used (wear), Media Errors, and Critical Warning flags.

6) Run self-tests

sudo smartctl -t short /dev/sda    # ~2 minutes
sudo smartctl -t long /dev/sda     # hours — schedule off-peak
sudo smartctl -l selftest /dev/sda

Self-test log shows pass/fail and which LBA failed if problematic.

7) Enable SMART monitoring daemon

sudo systemctl enable --now smartd
sudo smartctl -s on /dev/sda

Configure /etc/smartd.conf to email on attribute changes — especially for servers without hands-on disk access.

8) When to replace

Replace on FAILED health, steadily climbing reallocated sectors, or NVMe critical warnings. Plan replacement on elevated wear above 80% on production SSDs. Keep backups regardless — SMART catches many failures, not all.

9) Schedule regular checks

echo 'DEVICESCAN -a -o on -s (S/../.././02|L/../../7/04)' | sudo tee /etc/smartd.conf

Short self-test every day at 2 AM, long test weekly — adjust mail address in smartd config for alerts on attribute threshold breaches.

Verify

sudo smartctl -H /dev/sda
sudo smartctl -A /dev/sda | grep -E 'Reallocated|Pending|Power_On'

Baseline attributes after install; compare monthly to spot trends before catastrophic failure.

Related guides

disk health smart storage