Skip to content

Entries tagged "smartctl".

Smartctl - a note to myself

A note to my future self as I never seem to remember these smartctl commands (partly and fortunately because I don't need them often):
1. Quick check
/usr/sbin/smartctl -q errorsonly -H -l selftest -l error /dev/sdX
2. Run some tests if the command above reported any errors:
smartctl -t short /dev/sdX && smartctl -l selftest /dev/sdX

hdsentinel - or let's make smartctl reports readable

I am sure lots of you have had problems in the past or simple annoyances because of the way smartctl reports stuff. Although sometimes it's good to have more information, when it comes to routine hard drive check less is more. And this is where hdsentinel comes in handy - it takes the reports from smartctl and makes it "human readable" it directly queries the HDD for S.M.A.R.T. data and displays it in a nice human readable format.
Here's how a hdsentinel report looks like (the red lines are my doing):
HDD Device  1: /dev/sdb
HDD Model ID : ST3250410AS
HDD Serial No: 9RY3E558
HDD Revision : 4.AAA
HDD Size     : 238475 MB
Interface    : S-ATA II
Temperature  : 41 °C
Health       : 30 %
Performance  : 100 %
Power on time: 603 days, 9 hours
Est. lifetime: 109 days 
You can get even more information nicely formatted by using the -r switch (report).
And here's how a normal smartctl report looks like:
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.10 family
Device Model:     ST3250410AS
Serial Number:    9RY3E558
Firmware Version: 4.AAA
User Capacity:    250,059,350,016 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Sun Nov 28 23:37:14 2010 EET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82)	Offline data collection activity
					was completed without error.
					Auto Offline Data Collection: Enabled.
Self-test execution status:      (  40)	The self-test routine was interrupted
					by the host with a hard or soft reset.
Total time to complete Offline 
data collection: 		 ( 430) seconds.
Offline data collection
capabilities: 			 (0x5b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   1) minutes.
Extended self-test routine
recommended polling time: 	 (  64) minutes.
SCT capabilities: 	       (0x0001)	SCT Status supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   100   253   006    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0003   098   098   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       13
  5 Reallocated_Sector_Ct   0x0033   049   049   036    Pre-fail  Always       -       2045
  7 Seek_Error_Rate         0x000f   086   060   030    Pre-fail  Always       -       436557316
  9 Power_On_Hours          0x0032   084   084   000    Old_age   Always       -       14482
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       15
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   061   056   045    Old_age   Always       -       39 (Lifetime Min/Max 21/44)
194 Temperature_Celsius     0x0022   039   044   000    Old_age   Always       -       39 (0 21 0 0)
195 Hardware_ECC_Recovered  0x001a   061   048   000    Old_age   Always       -       228084472
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0000   100   253   000    Old_age   Offline      -       0
202 TA_Increase_Count       0x0032   100   253   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Interrupted (host reset)      80%     14481         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
I think hdsentinel is well worth giving a shot, if only for the time it will save you in the data centre when doing batch checks.

Read more about the linux version here.
Download from here (just download, gunzip and run as root - yeah, it's not open source, but oh well...).
There are also versions for Windows Server if you're interested in such alternatives.