smartctl(8)
Display or set SMART (Self-Monitoring, Analysis and Reporting Technology) attributes and thresholds on storage devices.
Synopsis
smartctl [OPTION]... DEVICEDescription
smartctl is the command-line interface to the smartmontools SMART monitoring daemon. It communicates with storage devices (hard drives, SSDs, NVMe drives) to retrieve SMART data, run self-tests, and configure alert thresholds. SMART monitoring helps predict drive failures before they occur.
Most operations require superuser privileges. Devices are typically specified as /dev/sda, /dev/nvme0n1, /dev/sdb, etc. Use smartctl -i to identify a device and verify it supports SMART.
Common options
| Flag | What it does |
|---|---|
-i, --info | Show device identity and SMART capabilities information |
-H, --health | Check overall SMART health status and report any issues |
-A, --attributes | Display all SMART attributes, current values, and thresholds |
-l error | Show error log from the drive, useful for diagnosing problems |
-t short | Run a short self-test (usually 1-2 minutes) |
-t long | Run a comprehensive self-test (hours for large drives) |
-l selftest | Display results of previous self-tests |
-a | Show all SMART information in one command |
-n standby | Don't wake up sleeping drive; check if it's spinning |
-d TYPE | Specify device type (auto, ata, scsi, nvme) if auto-detection fails |
Examples
Display device info and confirm SMART is supported on /dev/sda
sudo smartctl -i /dev/sdaQuick health check; outputs PASSED or FAILED
sudo smartctl -H /dev/sdaCheck the reallocated sectors count, indicating early drive wear
sudo smartctl -A /dev/sda | grep 'Reallocated_Sector_Ct'Start a short self-test on the drive
sudo smartctl -t short /dev/sdaView results of all previous self-tests
sudo smartctl -l selftest /dev/sdaShow the error log for recent read/write failures
sudo smartctl -l error /dev/sdaDump all SMART information (identity, attributes, logs, tests)
sudo smartctl -a /dev/sdaDisplay info for an NVMe SSD using explicit device type
sudo smartctl -d nvme --info /dev/nvme0n1