Polls

Topics

Monitoring hard disk health with smartd under Linux or UNIX operating systems

Posted by Vivek on Wednesday May 3, 06 @2:37 pm

smartd is SMART Disk Monitoring Daemon for Linux. SMART is acronym for Self-Monitoring, Analysis and Reporting Technology (SMART) system built 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.

smartd works with following operating systems:

  1. Linux
  2. *BSD
  3. Windows
  4. Solaris etc

How do I Install smartd?

However, smartd is not installed by default. Following are distribution specific steps to install smartd:

Debian Linux:
# apt-get install smartmontools
Red hat/Fedora Linux:
# rpm –ivh kernel-utils
OR
# up2date kernel-utils
OR if you are using Fedora Linux
# yum kernel-utils
FreeBSD:
# pkg_add -r -v smartmontools

Before configuring hard disk for SMART monitoring make sure your hard disk is SMART capable:
# smartctl -i /dev/hda
Output:

smartctl version 5.34 [i686-pc-linux-gnu] Copyright (C) 2002-5 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model:     SAMSUNG SV2002H
Serial Number:    0395J1FR904324
Firmware Version: RA100-04
User Capacity:    20,060,651,520 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   6
ATA Standard is:  ATA/ATAPI-6 T13 1410D revision 1
Local Time is:    Tue May  2 15:44:09 2006 IST

SMART support is: Available - device has SMART capability.
SMART support is: Enabled

You can configure the smartd daemon by editing the file /etc/smartd.conf. 

In above output the lines:
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

Indicates that it is SMART capable and it is enabled.

Configure SMARTD

Debian Linux

Red Hat Linux

FreeBSD

Example

You can put following directives in Smart Configuration file:
(a) Send an email to alert@nixcraft.in for /dev/sdb:
/dev/sdb -m alert@nixcraft.in
(b) Read error log:
# smartctl -l error /dev/hdb
(c) Testing hard disk (short or long test):
# smartctl -t short /dev/hdb
# smartctl -t long /dev/hdb

Caution smartd is a monitoring tool not a backup solution. Always perform data backup.

See also:

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in...

Discussion on This Article:

  1. soraver Says:

    Just to add that if you get the “Device does not support SMART” error with the “smartctl -i /dev/hda” command, but hddtemp or another smart based app is working, you might need to add the “-d ata” option :D

    # smartctl -i /dev/sdb
    smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    Device: ATA SAMSUNG HD501LJ Version: CR10
    Serial number: S0MUJ1QP503708
    Device type: disk
    Local Time is: Tue Feb 26 13:18:16 2008 EET
    Device does not support SMART

    # smartctl -i /dev/sdb -d ata
    smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF INFORMATION SECTION ===
    Device Model: SAMSUNG HD501LJ
    Serial Number: S0MUJ1QP503708
    Firmware Version: CR100-10
    User Capacity: 500,107,862,016 bytes
    Device is: In smartctl database [for details use: -P show]
    ATA Version is: 8
    ATA Standard is: Not recognized. Minor revision code: 0×52
    Local Time is: Tue Feb 26 13:20:56 2008 EET

    ==> WARNING: May need -F samsung or -F samsung2 enabled; see manual for details.

    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled

    :)

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , , , , , ~ Last updated on: July 4, 2007

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.