Test If Linux Server SCSI / SATA Hard Disk Going Bad

by on July 4, 2007 · 16 comments· LAST UPDATED July 10, 2012

in , ,

One of our regular reader sends us a question:

How can I test if my hard disk is going bad? I see few errors in /var/log/messages file.

I/O errors in /var/log/messages indicates that something is wrong with the hard disk and it may be failing. You can check hard disk for errors using smartctl command, which is control and monitor utility for SMART disks under Linux / UNIX like operating systems.

smartctl controls the 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.

smartctl for servers

smartctl is a command line utility designed to perform SMART tasks such as printing the SMART self-test and error logs, enabling and disabling SMART automatic testing, and initiating device self-tests. First, make sure S.M.A.R.T. support is enabled in the BIOS. Next, run the following command to see if your hard disks support S.M.A.R.T technology or not:
# smartctl -i /dev/sdb
To enable SMART, run:
# smartctl -s on -d ata /dev/sdb
Sample outputs:

smartctl version 5.33 [x86_64-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.

Run overall-health self-assessment test, enter:
# smartctl -d ata -H /dev/sdb
Sample outputs:

smartctl version 5.33 [x86_64-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

A sample output from failing hard disk:

smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
190 Airflow_Temperature_Cel 0x0022   044   033   045    Old_age   Always   FAILING_NOW 56 (96 110 58 25)

The following will provide even more information about failing hard disk:
# smartctl --attributes --log=selftest /dev/sda
Sample outputs:

smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
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   098   092   006    Pre-fail  Always       -       238320363
  3 Spin_Up_Time            0x0003   100   100   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       587
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       9
  7 Seek_Error_Rate         0x000f   077   060   030    Pre-fail  Always       -       51672328
  9 Power_On_Hours          0x0032   095   095   000    Old_age   Always       -       4805
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       586
184 Unknown_Attribute       0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       417
188 Unknown_Attribute       0x0032   100   099   000    Old_age   Always       -       4295032833
189 High_Fly_Writes         0x003a   094   094   000    Old_age   Always       -       6
190 Airflow_Temperature_Cel 0x0022   044   033   045    Old_age   Always   FAILING_NOW 56 (96 122 58 25)
194 Temperature_Celsius     0x0022   056   067   000    Old_age   Always       -       56 (0 23 0 0)
195 Hardware_ECC_Recovered  0x001a   043   026   000    Old_age   Always       -       238320363
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       49
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       49
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       172082159686339
241 Unknown_Attribute       0x0000   100   253   000    Old_age   Offline      -       2155546016
242 Unknown_Attribute       0x0000   100   253   000    Old_age   Offline      -       3048586928
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%      4789         1746972641

You can read more data from hard disk by typing the following command:
# smartctl -d ata -a /dev/sdb
Output:

smartctl version 5.33 [x86_64-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
Device Model:     WDC WD2500YS-01SHB0
Serial Number:    WD-WCANY1729333
Firmware Version: 20.06C03
User Capacity:    251,000,193,024 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   7
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Wed Jul  4 15:04:38 2007 CDT
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:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                 (7800) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        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:        (   2) minutes.
Extended self-test routine
recommended polling time:        (  92) minutes.
Conveyance self-test routine
recommended polling time:        (   6) minutes.
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     0x000f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0003   190   187   021    Pre-fail  Always       -       5500
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       24
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   200   200   051    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   092   092   000    Old_age   Always       -       6382
 10 Spin_Retry_Count        0x0013   100   253   051    Pre-fail  Always       -       0
 11 Calibration_Retry_Count 0x0013   100   253   051    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       23
194 Temperature_Celsius     0x0022   127   096   000    Old_age   Always       -       23
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0009   200   200   051    Pre-fail  Offline      -       0
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]
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.

A note about RAID controller

To look at ATA disks behind 3ware SCSI RAID controllers, the syntax is:
# smartctl -a -d 3ware,2 /dev/sda
# smartctl -a -d 3ware,0 /dev/twe0

See how to use the smartctl command to check disk behind Adaptec RAID controllers and hard disk behind 3Ware RAID cards for more information.

Task: Extended self-test of drive

You need to begin an extended self-test of drive /dev/hdc. You can issue this command on a running system. The results can be seen in the self-test log visible with the '-l selftest' option after it has completed:
# smartctl -d ata -t long /dev/sdb

Sample failing hard Disk detailed report

# smartctl -a /dev/sda
Sample outputs:

smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
Device Model:     ST31500341AS
Serial Number:    9VS0TG4B
Firmware Version: CC1H
User Capacity:    1,500,301,910,016 bytes
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:    Mon Oct 26 21:16:15 2009 IST
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
See vendor-specific Attribute list for marginal Attributes.
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:      (   0)	The previous self-test routine completed
					without error or no self-test has ever
					been run.
Total time to complete Offline
data collection: 		 ( 617) seconds.
Offline data collection
capabilities: 			 (0x7b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					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: 	 ( 255) minutes.
Conveyance self-test routine
recommended polling time: 	 (   2) minutes.
SCT capabilities: 	       (0x103f)	SCT Status supported.
					SCT Feature Control supported.
					SCT Data Table 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   098   092   006    Pre-fail  Always       -       238338845
  3 Spin_Up_Time            0x0003   100   100   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       587
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       9
  7 Seek_Error_Rate         0x000f   077   060   030    Pre-fail  Always       -       51672525
  9 Power_On_Hours          0x0032   095   095   000    Old_age   Always       -       4806
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       586
184 Unknown_Attribute       0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       417
188 Unknown_Attribute       0x0032   100   099   000    Old_age   Always       -       4295032833
189 High_Fly_Writes         0x003a   094   094   000    Old_age   Always       -       6
190 Airflow_Temperature_Cel 0x0022   044   033   045    Old_age   Always   FAILING_NOW 56 (96 126 58 25)
194 Temperature_Celsius     0x0022   056   067   000    Old_age   Always       -       56 (0 23 0 0)
195 Hardware_ECC_Recovered  0x001a   043   026   000    Old_age   Always       -       238338845
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       49
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       49
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       107168023974595
241 Unknown_Attribute       0x0000   100   253   000    Old_age   Offline      -       2155546480
242 Unknown_Attribute       0x0000   100   253   000    Old_age   Offline      -       3048590512
SMART Error Log Version: 1
ATA Error Count: 416 (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 416 occurred at disk power-on lifetime: 4786 hours (199 days + 10 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 08 ff ff ff ef 00      00:55:03.917  READ DMA EXT
  27 00 00 00 00 00 e0 00      00:55:03.818  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:55:03.798  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      00:55:03.779  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      00:55:03.658  READ NATIVE MAX ADDRESS EXT
Error 415 occurred at disk power-on lifetime: 4786 hours (199 days + 10 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 08 ff ff ff ef 00      00:55:00.927  READ DMA EXT
  27 00 00 00 00 00 e0 00      00:55:00.837  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:55:00.817  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      00:55:00.800  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      00:55:00.747  READ NATIVE MAX ADDRESS EXT
Error 414 occurred at disk power-on lifetime: 4786 hours (199 days + 10 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 08 ff ff ff ef 00      00:54:57.903  READ DMA EXT
  27 00 00 00 00 00 e0 00      00:54:57.807  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:54:57.787  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      00:54:57.757  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      00:54:57.637  READ NATIVE MAX ADDRESS EXT
Error 413 occurred at disk power-on lifetime: 4786 hours (199 days + 10 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 08 ff ff ff ef 00      00:54:54.862  READ DMA EXT
  27 00 00 00 00 00 e0 00      00:54:54.767  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:54:54.746  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      00:54:54.728  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      00:54:54.677  READ NATIVE MAX ADDRESS EXT
Error 412 occurred at disk power-on lifetime: 4786 hours (199 days + 10 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 08 ff ff ff ef 00      00:54:51.838  READ DMA EXT
  27 00 00 00 00 00 e0 00      00:54:51.736  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:54:51.716  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      00:54:51.685  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      00:54:51.566  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%      4789         1746972641
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.

Restore From Backup

If any one of these test reports error, replace the hard disk and restore the data from backups.

Configure smartd on server to get email based warnings if problems are detected

smartd is a daemon that monitors hard disk and it will attempt to enable SMART monitoring on hard disks. It polls hard disk health data and SCSI devices every 30 minutes (configurable option). It logs SMART errors and changes of SMART Attributes via the SYSLOG interface. The default location for these SYSLOG notifications and warnings is system-dependent (typically /var/log/messages or /var/log/syslog). In addition to logging to a file, smartd can also be configured to send email warnings if problems are detected. Depending upon the type of problem, you may want to run self-tests on the disk, back up the disk, replace the disk, or use a manufacturer's utility to force reallocation of bad or unreadable disk sectors. See how to install and configure smartd for more information.

Gnome disk utility

Most Linux and Unix like oses such as FreeBSD or OpenBSD comes with a gui tool called Disk Utility. This will only work, if you are running gnome based desktop or laptop system. To start Disk utility visit:
Applications > System Tools > Disk Utility
Click on the hard disk:

Linux 500 GB Hard Disk (ATA TOSHIBA MK5061GSYF) [-dev-sda]  Disk Utility Failing

To view details click on smart data:

Linux: Find out if your HDD is dying on a Linux server / laptop / desktop

An example of healthy hard disk:

Linux 500 GB Hard Disk (ATA ST9500420ASG) [-dev-sdb] — Disk Utility

Say hello to GSmartControl

GSmartControl is hard disk drive health inspection tool and a graphical user interface for smartctl command. This tool has the following features:

  1. Automatically reports and highlights any anomalies;
  2. Allows enabling/disabling SMART;
  3. Allows enabling/disabling Automatic Offline Data Collection - a short self-check that the drive will perform automatically every four hours with no impact on performance;
  4. Supports configuration of global and per-drive options for smartctl;
  5. Performs SMART self-tests;
  6. Displays drive identity information, capabilities, attributes, and self-test/error logs;
  7. Can read in smartctl output from a saved file, interpreting it as a read-only virtual device;
  8. Works on most smartctl-supported operating systems like *BSD and various Linux distros;
  9. Has extensive help information.

You can install it as follows on Debian or Ubuntu based systems using the apt-get command:
$ sudo apt-get install gsmartcontrol
On Fedora or RHEL or CentOS Linux use the yum command as follows to install the same:
# yum install gsmartcontrol
Sample outputs:

GSmartControl Linux / Windows / Unix GUI Tool To Test Hard Disk Health

Fig.01: GSmartControl in action

Click on the hard disk to see more information:

GSmartControl - a GUI interface to Linux / Windows / Unix / BSD smartctl command

Fig.02: GSmartControl displaying hard disk information

Click on Attributes tab:

Fig.06: GSmartControl displaying hard disk attribution information

Click on Perform test tab to execute short or long hard disk test:

Fig.08: Hard disk test is in progress

References:
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 16 comments… read them below or add one }

1 Bruno July 5, 2007 at 8:07 am

Don’t expect too much from SMART : Failure Trends in a Large Disk Drive Population http://www.usenix.org/events/fast07/tech/full_papers/pinheiro/pinheiro.pdf
We present data collected from detailed observations of a large disk drive population in a production Internet services deployment
… models based on SMART parameters alone are unlikely to be useful for predicting individual drive failures. …

Reply

2 nixCraft July 5, 2007 at 4:43 pm

Bruno,

Yes, no tool is perfect; admin must use on his/her experience while diagnosing a problem. I’m downloading and reading PDF.

Appreciate your post.

Reply

3 Jayesh July 7, 2007 at 10:51 pm

Really Thanks a lot for such usefull information. Thanks for sharing that.
Cheers..!!

Reply

4 Karl O. Pinc August 7, 2007 at 3:29 pm

The badblocks utility, part of the e2fs suite of tools, is good way to test a drive. It is probably more through than the on-drive smart diagnostics, when run in write mode. The down side of write mode is that it destroys any existing data — although this can be an advantage if you wish to throughly remove all data from a drive. badblocks works on non-smart capable drives as well.

Reply

5 Brett Cave December 18, 2007 at 2:01 pm

Badblocks has both “non-destructive” and “destructive” modes of testing (write vs read).

read the man page to avoid data loss. (I learnt the hard way:)

Reply

6 Zen of Linux February 10, 2009 at 2:14 am

Thank you for your post! It was of great help while compiling my view on things, while testing capabilities of SMART to monitor my drives and if it is of any help to predict when a drive will die.

Reply

7 mike May 26, 2009 at 11:32 pm

Pardon my ignorance, but is your output that of a failing drive or a healthy drive? I have very similar output, after just dealing with filesystem problems fixed with e2fsck. My output http://paste.ubuntu.com/181613/ Thanks!

Reply

8 nixCraft May 26, 2009 at 11:45 pm

a healthy drive

Reply

9 icebrian November 4, 2009 at 4:20 pm

Also pardon my ignorace, but could you check http://pastebin.com/m17a6af7b I have four drives there and I suspect one may-be two are faulty (no possible repair).

Reply

10 linux November 10, 2010 at 8:02 pm

how do you get it out of read only?

Reply

11 randomguy April 12, 2011 at 10:26 am

Bruno, SMART data is definitely worth paying attention to. Any one of 4 of the categories of errors listed needs only 1 error to increase the chance of a disk failure by 10 or more in the next 60 days. So, bad SMART data will certainly indicate that a drive should be replaced. However, drives can also fail without any warning too.

Reply

12 nrynn May 14, 2012 at 2:48 am

I think my drive may have crapped. I saw a “Read only file system” trying to log some things. Logged in a s root and still no luck writing to the disk. Then forced a fcsk with a reboot – still no luck. A ‘df’ does not even show that drive now. Any thoughts/ideas?

Reply

13 rst_ack May 22, 2012 at 6:19 pm

touch /forcefsck && /sbin/reboot

OR

/sbin/shutdown -rF now

Reply

14 Rune K. Svendsen July 19, 2012 at 4:56 pm

Thanks for your advice on badblocks Karl! I was looking and looking for a way to test an old, non SMART-capable HDD about which the kernel is saying “rejecting I/O to dead device”.

Reply

15 royanon November 29, 2012 at 6:01 pm

How could that 500GB ATA power up for 15 years…
I wonder how much is that 15 years ago….

Reply

16 nixCraft December 1, 2012 at 2:29 pm

My dying hard disk…

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , ,

Previous post:

Next post: