smartctl

Updated

September 4, 2026

Overview

smartctl (from smartmontools) queries disk S.M.A.R.T. health data: overall assessment, attributes, error logs, and self-tests. Use it for predictive failure monitoring on HDDs/SSDs/NVMe (device-dependent).

sudo apt install smartmontools

Syntax

sudo smartctl [options] device

Common Options

Option Description
-a / -x All / extended SMART info
-H Overall health PASS/FAIL
-i Identity
-A Vendor attributes table
-l error Error log
-l selftest Self-test log
-t short\|long\|conveyance Start self-test
-s on Enable SMART (if disabled)
-d type Device type (raid, nvme, …)

Safety

  • Long self-tests stress disks — schedule during maintenance.
  • On hardware RAID, you often need -d megaraid,N or controller tools; smartctl on /dev/sdX may talk to the virtual disk only.
  • SMART “PASSED” is not a guarantee — watch reallocated sectors and media errors over time.

Examples with Explanations

Health summary

sudo smartctl -H /dev/sda
sudo smartctl -i /dev/sda

Full report

sudo smartctl -a /dev/sda | less
sudo smartctl -x /dev/nvme0 | less

Short self-test

sudo smartctl -t short /dev/sda
# wait, then:
sudo smartctl -l selftest /dev/sda

Watch failure predictors

sudo smartctl -A /dev/sda | egrep -i 'reall|pend|uncorrect|media|temperature'

Scan devices

sudo smartctl --scan

Additional Resources

  • man smartctl
  • smartmontools FAQ