$linuxjunkies
>

smartctl(8)

Display or set SMART (Self-Monitoring, Analysis and Reporting Technology) attributes and thresholds on storage devices.

UbuntuDebianFedoraArch

Synopsis

smartctl [OPTION]... DEVICE

Description

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

FlagWhat it does
-i, --infoShow device identity and SMART capabilities information
-H, --healthCheck overall SMART health status and report any issues
-A, --attributesDisplay all SMART attributes, current values, and thresholds
-l errorShow error log from the drive, useful for diagnosing problems
-t shortRun a short self-test (usually 1-2 minutes)
-t longRun a comprehensive self-test (hours for large drives)
-l selftestDisplay results of previous self-tests
-aShow all SMART information in one command
-n standbyDon't wake up sleeping drive; check if it's spinning
-d TYPESpecify 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/sda

Quick health check; outputs PASSED or FAILED

sudo smartctl -H /dev/sda

Check 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/sda

View results of all previous self-tests

sudo smartctl -l selftest /dev/sda

Show the error log for recent read/write failures

sudo smartctl -l error /dev/sda

Dump all SMART information (identity, attributes, logs, tests)

sudo smartctl -a /dev/sda

Display info for an NVMe SSD using explicit device type

sudo smartctl -d nvme --info /dev/nvme0n1

Related commands