Knowledge base / Linux & server administration

Checking disk health with smartctl

Most disks warn before they fail. smartctl (package smartmontools) reads those warnings.

Quick health check

smartctl -H /dev/sda
smartctl -a /dev/sda          # SATA/SAS: full report
smartctl -a /dev/nvme0n1      # NVMe

What to look at

Behind a hardware RAID controller

Disks are hidden behind the controller. Use the device type, for example smartctl -a -d megaraid,0 /dev/sda for LSI/Broadcom, or the vendor tool (storcli, ssacli, iDRAC/iLO).

Run tests and get alerts

smartctl -t long /dev/sda     # results later in smartctl -a

Enable smartd so you get an email when a disk starts failing, or add SMART checks to your monitoring. On a managed plan, we monitor this for you and arrange the replacement.