smartctl
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 smartmontoolsSyntax
sudo smartctl [options] deviceCommon 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,Nor controller tools; smartctl on/dev/sdXmay 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/sdaFull report
sudo smartctl -a /dev/sda | less
sudo smartctl -x /dev/nvme0 | lessShort self-test
sudo smartctl -t short /dev/sda
# wait, then:
sudo smartctl -l selftest /dev/sdaWatch failure predictors
sudo smartctl -A /dev/sda | egrep -i 'reall|pend|uncorrect|media|temperature'Scan devices
sudo smartctl --scanAdditional Resources
man smartctl
- smartmontools FAQ