tips
19 tips Smart
One command, setting or habit at a time about Smart: what it does, the line to copy and a caveat or two.
Quick checks 7
-
Decodes the smartctl exit status so your script knows what went wrong.
sudo smartctl -q silent -a /dev/sda -
Shows device statistics with plain descriptions instead of vendor attribute numbers.
sudo smartctl -l devstat /dev/sda -
Reads the temperature graph the drive recorded itself, even without monitoring software.
sudo smartctl -l scttemphist /dev/sda -
Prints the extended error log of a disk, with the failed commands and when they happened.
sudo smartctl -l xerror /dev/sda -
Shows wear, spare capacity and error counts of an NVMe drive.
sudo smartctl -a /dev/nvme0 -
Filters the smart attributes down to reallocated, pending, uncorrectable and CRC error counts.
sudo smartctl -A /dev/sda | grep -E '^ *(5|197|198|199) ' -
Prints the overall smart health verdict of a drive in one line.
sudo smartctl -H /dev/sda
Setup and devices 6
-
Helps separate a bad cable or port from a bad disk.
sudo smartctl -l sataphy /dev/sda -
Reads SMART data only when a disk is awake, so a check never spins it up.
sudo smartctl -n standby -H /dev/sdb -
Shows and sets how long a hard disk retries a bad sector before it reports an error.
sudo smartctl -l scterc /dev/sda -
Reads the smart data of a USB-attached drive by using SAT pass-through.
sudo smartctl -d sat -a /dev/sdb -
Lists the devices smartctl can read and the -d type that fits each.
sudo smartctl --scan -
Lets the smartd daemon test drives on a schedule and mail you the warnings.
DEVICESCAN -a -m root -s (S/../.././02|L/../../6/03)
Self-tests 3
-
Tests only a suspicious area of a disk instead of the whole surface.
sudo smartctl -t select,1000000-2000000 /dev/sda -
Starts a full-surface self-test inside the drive and shows how long it will take.
sudo smartctl -t long /dev/sda -
Starts a quick background self-test on the drive and reads the result from its log.
sudo smartctl -t short /dev/sda
SMART alerts 2
-
Silences a known SMART warning on a disk so you only get alerted again when it changes.
Dashboard > orange icon next to the disk > Acknowledge -
Saves a full SMART report of one disk to a file you can attach to a support post.
smartctl -a /dev/sdX > /boot/smart_report.txt
Identify and inspect 1
-
Reads wear, temperature and error counters straight from an NVMe drive.
sudo nvme smart-log /dev/nvme0
Nothing in this filter yet.