Skip to content


How to check disk health in Linux

Quite simple: smartctl -a [device]
What this does it simply read and process S.M.A.R.T. data.

For even more details, see: http://www.cyberciti.biz/tips/linux-find-out-if-harddisk-failing.html
(for instance smartctl -d ata -t long [device])

Below is an example output from one of my drives, with some issues:

> smartctl -a /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.2.13-grsec-xxxx-grs-ipv6-64] (SUSE RPM)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     ST2000DM001-XXXXXX
Serial Number:    Z1XXXXXX
LU WWN Device Id: 5 xxxxxx xxxxxxxxx
Firmware Version: CC4H
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Thu Jul 25 04:48:14 2013 EDT
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:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                (  575) seconds.
Offline data collection
capabilities:                    (0x73) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        No Offline surface scan supported.
                                        Self-test supported.
                                        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:        ( 224) minutes.
Conveyance self-test routine
recommended polling time:        (   2) minutes.
SCT capabilities:              (0x3085) 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   115   097   006    Pre-fail  Always       -       96680688
  3 Spin_Up_Time            0x0003   094   094   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       85
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   087   060   030    Pre-fail  Always       -       4947608449
  9 Power_On_Hours          0x0032   090   090   000    Old_age   Always       -       8765
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       83
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       576
188 Command_Timeout         0x0032   100   095   000    Old_age   Always       -       4295032841
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   065   056   045    Old_age   Always       -       35 (Min/Max 18/43)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       82
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       957
194 Temperature_Celsius     0x0022   035   044   000    Old_age   Always       -       35 (0 7 0 0 0)
197 Current_Pending_Sector  0x0012   097   097   000    Old_age   Always       -       600
198 Offline_Uncorrectable   0x0010   097   097   000    Old_age   Offline      -       600
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       111368501993865
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       96320646201
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       1482116076162

SMART Error Log Version: 1
ATA Error Count: 574 (device log contains only the most recent five errors)
        CR = Command Register [HEX]
        FR = Features Register [HEX]
        SC = Sector Count Register [HEX]
        SN = Sector Number Register [HEX]
        CL = Cylinder Low Register [HEX]
        CH = Cylinder High Register [HEX]
        DH = Device/Head Register [HEX]
        DC = Device Command Register [HEX]
        ER = Error register [HEX]
        ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 574 occurred at disk power-on lifetime: 7419 hours (309 days + 3 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 48 ff ff ff ef 00  37d+06:30:50.798  READ DMA EXT
  27 00 00 00 00 00 e0 00  37d+06:30:50.797  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00  37d+06:30:50.789  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00  37d+06:30:50.785  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00  37d+06:30:50.761  READ NATIVE MAX ADDRESS EXT

Error 573 occurred at disk power-on lifetime: 7419 hours (309 days + 3 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 48 ff ff ff ef 00  37d+06:30:45.100  READ DMA EXT
  27 00 00 00 00 00 e0 00  37d+06:30:45.100  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00  37d+06:30:45.093  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00  37d+06:30:45.046  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00  37d+06:30:44.952  READ NATIVE MAX ADDRESS EXT

Error 572 occurred at disk power-on lifetime: 7419 hours (309 days + 3 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 48 ff ff ff ef 00  37d+06:30:37.990  READ DMA EXT
  25 00 08 ff ff ff ef 00  37d+06:30:37.983  READ DMA EXT
  25 00 10 ff ff ff ef 00  37d+06:30:37.921  READ DMA EXT
  25 00 08 ff ff ff ef 00  37d+06:30:37.909  READ DMA EXT
  25 00 08 ff ff ff ef 00  37d+06:30:37.882  READ DMA EXT

Error 571 occurred at disk power-on lifetime: 6784 hours (282 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 00 ff ff ff ef 00  10d+19:40:33.223  READ DMA EXT
  27 00 00 00 00 00 e0 00  10d+19:40:33.222  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00  10d+19:40:33.214  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00  10d+19:40:33.207  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00  10d+19:40:33.182  READ NATIVE MAX ADDRESS EXT

Error 570 occurred at disk power-on lifetime: 6784 hours (282 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 00 ff ff ff ef 00  10d+19:40:30.298  READ DMA EXT
  27 00 00 00 00 00 e0 00  10d+19:40:30.297  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00  10d+19:40:30.289  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00  10d+19:40:30.281  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00  10d+19:40:30.257  READ NATIVE MAX ADDRESS EXT

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed: read failure       90%      9634         231252752
# 2  Short offline       Completed without error       00%      3448         -
# 3  Short offline       Completed without error       00%      3436         -
# 4  Short offline       Completed without error       00%      3436         -
# 5  Short offline       Completed without error       00%        17         -
# 6  Short offline       Completed without error       00%         5         -
# 7  Short offline       Completed without error       00%         5         -
# 8  Short offline       Completed without error       00%         4         -
# 9  Extended offline    Completed without error       00%         3         -

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.

Posted in hardware, Linux.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA