Self-Monitoring, Analysis, and Reporting Technology, or S.M.A.R.T., is a monitoring system built on some computer hard disks that stores (and on some hard drives detects) various indicators (SMART Attributes) for the hard disks reliability. It does so in the attempt to detect/prevent anticipatory failures.
SMART disks may either need software to update SMART Attributes on the hard drive or will include some built-in self tests to detect and protect the hard drive (see manufacturer details).
This article describes how to install the package smartmontools and use its programs to monitor your hard disk(s).
For the command line version:
pacman -S smartmontools
For the GUI version:
pacman -S gsmartcontrol
Check if your disk(s) support SMART.
smartctl -i /dev/hda
smartctl -i -d ata /dev/sda
If it is, you will see:
"SMART support is: Available - device has SMART capability." "SMART support is: Enabled"
If SMART is not enabled you can enable it by:
smartctl -s on /dev/hda
smartctl -s on -d ata /dev/sda
Test the hard drive
Your SMART hard disk may have built-in self-tests that do some checks to record the state of the hard disk and may optionally protect it from common problems (i.e. bad blocks). If you do not know for certain, have smartctl run tests to update the SMART Attributes on your hard disk.
To know first which tests the device supports:
smartctl -c /dev/<your-hard-disk>
To run the test:
smartctl -t offline /dev/<your-hard-disk>
smartctl will tell you how long the test will take. When it is finished you can check the health status to see if there are any problems.
Health status check
SMART hard disks keep a record of the hard disks health status that can be checked with:
smartctl -H /dev/sda
If the hard drive status is healthy it will return the status as: 'PASSED'.
If the device reports a failing health status, it means that the device has either already failed, or is predicting its own failure within the next 24 hours. Append the "-a" option to get more information.
To see if the SMART sensor has detected any errors, look at the SMART Error Log:
smartctl -l error /dev/sda
If "No Errors Logged" is printed, your hard drive is likely healthy. If there are a few errors this may or may not indicate a problem and you should investigate the matter further. Generally when a drive starts to fail it is best practice to backup its data and replace the hard drive.
See the man page for other tests and more information.
Automatically monitor your drives
smartmontools includes a daemon that will check and update your hard disks status and can optionally mail you of any potential problems. The smart daemon can be edited for more exact configuration in Template:Filename.
If the configuration is not edited, smartd will run tests periodically on all possible SMART Attributes on all devices it detects. The first non-commented entry in the configuration file (DEVICESCAN) will have smartd ignore the remaining lines in the configuration file, and will scan for devices. For devices with an ATA Attachment, if no options are configured, the daemon will use the '-a' option by default (monitor all SMART properties) on all hard drives.
To make a configuration for individual devices, you have to comment the line with DEVICESCAN and add a configuration line for every device. Here is an example:
#DEVICESCAN /dev/hda -a -m root@localhost
This will monitor all attributes and send an email to root@localhost if a failure or new error occurs. To be able to send internal mail, you need a mail sender (like SSMTP or Msmtp) installed, or a mail server (MTA Message Transfer Agent) like sendmail or Postfix. More examples are given in the configuration file.
To start the daemon:
If everything is working as it should, you can add smartd to your DAEMONS array in Template:Filename.
Other tips that can help setup smartmontool programs
Get SMART details
You can get all SMART details of your drive with:
smartctl -a /dev/hda
smartctl -a -d ata /dev/sda