Check Hard Drives for SMART Errors on Arch Linux

hard-drive-spindle

SMART tests can give an early warning of impending hard disk failures. On most Linux distributions smartmontools package can be used to execute SMART scans. The package consists of smartctl utility which controls and monitors SMART disks and systemd daemon. Only smartctl is needed to run SMART tests manually but smartd is also required to Configure Automatic SMART Error Checks on Arch Linux.

 

Install & Configure Smartmontools

Install smartmontools package.

sudo pacman -S smartmontools

 

Set the desired parameters on each had disk device in the system.

sudo smartctl -s on -o on -S on /dev/sda
sudo smartctl -s on -o on -S on /dev/sdb
sudo smartctl -s on -o on -S on /dev/sdc

Turn S.M.A.R.T support on or off with -s argument. Offline data collection is turned on or off with -o argument and turn autosave of device vendor-specific attributes on or off with -S argument.

 

Check for SMART Errors Manually

Run a short SMART test to check for errors.

sudo smartctl -t short /dev/sdb

The -t argument defines the type of test to be carried out. To run a different test replace short with longconveyance or offline. Lastly /dev/sdb specifies the device.

 

Check SMART Hard Disk Health

Show SMART test results.

sudo smartctl -l selftest /dev/sdb

Re-run the command until the test is complete. There is no way to track SMART test progress interactively.

 

Check the overall disk health.

sudo smartctl -H /dev/sdb

 

View all available SMART data.

sudo smartctl -a /dev/sdb

 

Refer to the smartd manual for more details.

man smartctl

 

Quick Reference

sudo pacman -S smartmontools
sudo smartctl -s on -o on -S on /dev/sda
sudo smartctl -s on -o on -S on /dev/sdb
sudo smartctl -s on -o on -S on /dev/sdc
sudo smartctl -t short /dev/sdb
sudo smartctl -l selftest /dev/sdb
sudo smartctl -H /dev/sdb
sudo smartctl -a /dev/sdb
man smartctl

Configure Automatic SMART Error Checks on Arch Linux

dom