Saturday, May 1, 2010

Monitoring SMART hdd data in linux

When I was using Windows, I used to manually monitor S.M.A.R.T. status of my hard disk drive, say, once a month with Everest utility program. Is there such a tool for GNU/Linux? The smartmontools package provides smartd SMART disk monitoring daemon and smartctl SMART disks control and monitor utility.

The command

# smartctl -i /dev/sda

prints the following information (-i) on my HDD (/dev/sda):

smartctl 5.39 2009-08-08 r2872~ [x86_64-unknown-linux-gnu] (openSUSE RPM)
Copyright (C) 2002-9 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family: Hitachi Travelstar 5K160 series
Device Model: HITACHI xxx######x#xx##
Serial Number: xx#x##x#xx#xxx
Firmware Version: SBDIC7JP
User Capacity: 120,034,123,776 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: ATA/ATAPI-7 T13 1532D revision 1
Local Time is: Sat May 1 23:01:43 2010 MSD
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


And the command

# smartctl -A /dev/sda

list all the familiar SMART attributes (-A) and their values:

smartctl 5.39 2009-08-08 r2872~ [x86_64-unknown-linux-gnu] (openSUSE RPM)
Copyright (C) 2002-9 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 062 Pre-fail Always - 0
2 Throughput_Performance 0x0005 100 100 040 Pre-fail Offline - 4564
3 Spin_Up_Time 0x0007 253 253 033 Pre-fail Always - 0
4 Start_Stop_Count 0x0012 099 099 000 Old_age Always - 3007
5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0
7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0
8 Seek_Time_Performance 0x0005 100 100 040 Pre-fail Offline - 0
9 Power_On_Hours 0x0012 081 081 000 Old_age Always - 8418
10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 099 099 000 Old_age Always - 2653
191 G-Sense_Error_Rate 0x000a 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 73465872
193 Load_Cycle_Count 0x0012 089 089 000 Old_age Always - 118737
194 Temperature_Celsius 0x0002 148 148 000 Old_age Always - 37 (Lifetime Min/Max 14/45)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x000a 200 253 000 Old_age Always - 0
223 Load_Retry_Count 0x000a 100 100 000 Old_age Always - 0


Please note, that all mentioned commands are executed in superuser mode.

By the way, manual page on -A (--attributes) key provides comprehensive information on interpretation of SMART attributes for newbies.

No comments:

Post a Comment