This page will describe how to setup SMART to monitor your harddisks.
Step 1: Install smartmontools
pacman -Sy smartmontools
Step 2: Check if your disk(s) support SMART
smartctl -i /dev/hda
smartctl -i -d ata /dev/sda
"SMART support is: Available - device has SMART capability."
"SMART support is: Enabled"
If SMART is NOT enabled you have to do this.
smartctl -s on /dev/hda
smartctl -s on -d ata /dev/sda
Step 3: Check your disk(s)
Check the SMART health status of a device
smartctl -H /dev/sda
I all goes well, it will return PASSED.
If the device reports failing health status, this means either that the device has already failed, or that it is predicting its own failure within the next 24 hours. If this happens, use the "-a" option to get more information, and get your data off the disk and someplace safe as soon as you can.
Check the SMART Error Log
smartctl -l error /dev/sda
If we read No Errors Logged it's ok. If there are a few errors (and they are not so recent) you don't have to worry too much. If there are a lot of errors it's better if you backup your data as soon as you can.
NOTE: This is not all tests but only two of them. See the manual or this wiki for more.
Step 4: Make smartd automatically monitor your drives
smartd can be configured at start-up using the configuration file /etc/smartd.conf. If no configuration exists smartd monitors for all possible SMART errors (corresponding to the "-a" Directive in the configuration file).
If the first non-comment entry in the configuration file is the text string DEVICESCAN in capital letters, then smartd will ignore any remaining lines in the configuration file, and will scan for devices. For an ATA device, if no Directives appear, then the device will be monitored as if the "-a" Directive (monitor all SMART properties) had been given.
To make configuration for invidual devices you have to comment the line with DEVICESCAN and add a configuration line for every device. Here is an example (more are given inside /etc/smart.conf):
#DEVICESCAN /dev/hda -a -m root@localhost
This will monitor all atributes and send a warning email to root@localhost if a failure or a new error occurs.
NOTE: To be able to send internal mail, you need a MTA like sendmail or postfix
Now start the deamon
If everything is working as it should, you can add smartd to your DAEMONS array in /etc/rc.conf