Kubuntu – How to Test Your Hard Disk Drive

Modern hard disk drives incorporate Self-Monitoring Analysis and Recording Technology, aka SMART.
Basically they have a degree of self-test capability that the user can access to help determine the health and life expectancy of a hard disk drive.

The tool I use is smartmontools.

There are others — many others.  “Bonnie++” is one, and a whole suite of hard drive diagnostic tools is available on the Ultimate Boot CD as described here.

However if you’re simply in a hurry to discover whether your hard drive is likely to crash tomorrow, or not, here’s the quick look:

1. Open a Konsole window and

sudo apt-get install smartmontools

2. Verify the manufacturer, model, and SMART capability, and look at the current state of health (as last recorded):

sudo smartctl -ia /dev/sda

Here is the output:

smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     SAMSUNG SpinPoint F3 series
Device Model:     SAMSUNG HD103SJ
Serial Number:    S246J9AB200533
Firmware Version: 1AJ10001
User Capacity:    1,000,204,886,016 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 6
Local Time is:    Thu Sep 15 20:09:40 2011 WEST
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:                 (9300) 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:        (   2) minutes.
Extended self-test routine
recommended polling time:        ( 155) minutes.
SCT capabilities:              (0x003f) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.

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     0x002f   100   100   051    Pre-fail  Always       -       0
2 Throughput_Performance  0x0026   252   252   000    Old_age   Always       -       0
3 Spin_Up_Time            0x0023   071   070   025    Pre-fail  Always       -       8924
4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       139
5 Reallocated_Sector_Ct   0x0033   252   252   010    Pre-fail  Always       -       0
7 Seek_Error_Rate         0x002e   252   252   051    Old_age   Always       -       0
8 Seek_Time_Performance   0x0024   252   252   015    Old_age   Offline      -       0
9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       1558
10 Spin_Retry_Count        0x0032   252   252   051    Old_age   Always       -       0
11 Calibration_Retry_Count 0x0032   252   252   000    Old_age   Always       -       0
12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       140
191 G-Sense_Error_Rate      0x0022   252   252   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0022   252   252   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0002   053   048   000    Old_age   Always       -       47 (Lifetime Min/Max 15/52)
195 Hardware_ECC_Recovered  0x003a   100   100   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   252   252   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   252   252   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   252   252   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0036   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x002a   100   100   000    Old_age   Always       -       0
223 Load_Retry_Count        0x0032   252   252   000    Old_age   Always       -       0
225 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       141

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

Note: selective self-test log revision number (0) not 1 implies that no selective self-test has ever been run
SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
1        0        0  Completed [00% left] (0-65535)
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.

 

3. Do the short test in offline mode:


sudo smartctl -t short /dev/sda

This takes a few minutes, depending on the drive model.

4. Later (by however many minutes, at least) check the self test log to see the test results:


sudo smartctl -l selftest /dev/sda

Here it says:

smartctl version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen</p><p>Home page is http://smartmontools.sourceforge.net/</p><p>=== START OF READ SMART DATA SECTION ===<br /> SMART Self-test log structure revision number 1<br /> Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error<br /> # 1  Short offline       Completed without error       00%     10570         -<br /> # 2  Short offline       Completed without error       00%      7486

5. If there is still reason for worry, and a couple of hours to do something else while the long test runs, then:

sudo smartctl -t long /dev/sda

After the time is completed, review the long test results with the same command as #4 above.

Read all the capabilities of smartmontools with

man smartctl

Leave a Reply

Your email address will not be published. Required fields are marked *

*