Storage‎ > ‎Storage-disk‎ > ‎

How to configure smartd to monitor hard disk health under Linux

Thank you for visiting this page, this page has been update in another link How to configure smartd to monitor hard disk health on linux
Smartd is a S.M.A.R.T Disk Monitoring Daemon, it monitors the self-monitoring, analysis and reporting S.M.A.R.T system build into many ATA-3 and later ATA,IDE and SCSI-3 hard drives. The purpose of SMART is to monitor the reliability of the hard drive and predict drive failures,  and to  carry  out  different types of drive self-tests.

1. The smartmontools is the package you need to install.

# rpm -ql smartmontools-5.43-1.el6.x86_64

2. To test if your disk is S.M.A.R.T capacible

#smartctl -i /dev/sda
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.18.1.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen,

Model Family:     Western Digital RE4 Serial ATA
Device Model:     WDC WD1003FBYX-01Y7B0
Serial Number:    WD-WCAW31325144
LU WWN Device Id: 5 0014ee 2b0447879
Firmware Version: 01.01V01
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon Nov 25 23:15:51 2013 PST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
It indicates the disk is SMART capable

3. Quick test

echo /dev/sdb -m -M test | smartd -c - -q onecheck

smartd 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.18.1.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen,

Opened configuration file <stdin>
Drive: /dev/sdb, implied '-a' Directive on line 1 of file <stdin>
Configuration file <stdin> parsed.
Device: /dev/sdb, type changed from 'scsi' to 'sat'
Device: /dev/sdb [SAT], opened
Device: /dev/sdb [SAT], WDC WD1003FBYX-01Y7B0, S/N:WD-WCAW31353191, WWN:5-0014ee-25aeef427, FW:01.01V01, 1.00 TB
Device: /dev/sdb [SAT], found in smartd database: Western Digital RE4 Serial ATA
Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Monitoring 1 ATA and 0 SCSI devices
Executing test of mail to ...
Test of mail to successful
Device: /dev/sdb [SAT], opened ATA device
Device: /dev/sdb [SAT], previous self-test completed without error
Started with '-q onecheck' option. All devices sucessfully checked once.
smartd is exiting (exit status 0)

4. Config smartd.conf

Default way:

# The word DEVICESCAN will cause any remaining lines in this
# configuration file to be ignored: it tells smartd to scan for all
# ATA and SCSI devices.  DEVICESCAN may be followed by any of the
# Directives listed below, which will be applied to all devices that
# are found.  Most users should comment out DEVICESCAN and explicitly
# list the devices that they wish to monitor.

Or as commented lines said, explicitly list the devices that you wish to monitor
#First two SCSI disks. This will monitor everything that smartd can monitor. Start extended self-tests Wednesdays between 6-7pm and Sundays between 1-2 am

/dev/sda -d scsi -s L/../../3/18
/dev/sdb -d scsi -s L/../../7/01

Or uncommented autogenerated config file options in /etc/sysconfig/smartmontools
#cat /etc/sysconfig/smartmontools
# command line options for smartd
smartd_opts="-q never"
# autogenerated config file options
smartd_conf_opts="-H -m root"

5. start or stop smartd

Start/Stop smart: /etc/init.d/smartd start | stop
#chkconfig smartd on