What is smartd and how to use it
smartd monitors hard disks using SMART, or Self-Monitoring, Analysis, and Reporting Technology, to analyze, check, report operating status, and predict whether a disk may fail. On older Linux versions, smartd comes with kernel-utils. On newer versions, it is in the smartmontools package. smartd generally starts at boot. Its configuration file is /etc/smartd.conf. To check whether a hard disk supports SMART, use:
smartctl -i /dev/harddisk_device
Example of a hard disk with SMART
smartctl -i /dev/hda
smartctl version 5.1-11 Copyright (C) 2002-3 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF INFORMATION SECTION === Device Model: ST380011A Serial Number: 3JVB672N Firmware Version: 8.01 Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 6 ATA Standard is: ATA/ATAPI-6 T13 1410D revision 2 Local Time is: Fri Aug 20 14:09:16 2004 EST SMART support is: Available - device has SMART capability. SMART support is: Enabled Example of a hard disk without SMART support, because some hardware RAID models are unsupported.
smartctl -i /dev/sda
smartctl version 5.36 [x86_64-redhat-linux-gnu] Copyright (C) 2002-6 Bruce Allen Home page is http://smartmontools.sourceforge.net/ Device: DELL PERC 6/i Version: 1.21 DELL PERC controllers are not supported. To configure smartd to monitor only selected devices, edit /etc/smartctl.conf. Specify the disks to monitor and an email address so important events (warnings) are emailed to the administrator. Example configuration to monitor /dev/hda and send important event (warning) notifications to [email protected]:
/etc/smartd.conf
Sample configuration file for smartd. See man 5 smartd.conf.
Home page is: http://smartmontools.sourceforge.net
…
A very silent check. Only report SMART health status if it fails
But send an email in this case
/dev/hda -a -m [email protected] … After editing, restart smartd with:
service smartd restart
Shutting down smartd: [FAILED] Starting smartd: [ OK ]