Skip to content

smart

https://www.thomas-krenn.com/en/wiki/SMART_tests_with_smartctl

apt install smartmontools

General drive information:

smartctl -i /dev/sda

Short all informations, including test results:

smartctl -a /dev/sda

Health assessment

https://www.thomas-krenn.com/en/wiki/Analyzing_a_Faulty_Hard_Disk_using_Smartctl

Show self-health-indicator:

smartctl -H /dev/sda

Show most important details:

smartctl -a /dev/sda | grep -iE '(error|uncorrect|pending|recovered|fail)' | grep -v '0$'

Smart attributes explained

See also ~/projects/monitoring/prometheus/varac-alerts/custom-alerts/custom-alerts-general.yaml

Critical:

Warning:

Informational:

Tests

https://www.thomas-krenn.com/de/wiki/SMART_Tests_mit_smartctl

Show duration of tests

smartctl -c /dev/sdc

Test in background mode

smartctl -t <short|long|conveyance> /dev/sdc

Test in foreground mode

Only useful if the drive is NOT used by any other process! Also, it blocks access to smart log, so if possible, use the background mode!

smartctl -t <short|long|conveyance> -C /dev/sdc

Show test results

smartctl -l selftest /dev/sdb

Issues with USB disks entering sleep mode

Tip: Poll test results in short intervals to prevent disk from sleeping

watch smartctl -l selftest /dev/sdb

NVME disks

USB drives

https://www.smartmontools.org/wiki/USB

smartctl -d sat -i /dev/sda

Prometheus