![](https://seccdn.libravatar.org/avatar/6cd07deb854cee921d244d9540a6e143.jpg?s=120&d=mm&r=g)
Hi, How can I be sure that my hard disk has badblocks? How can I test all the entire disk if it has badblocks? I'm getting this in my '/var/log/messages': ... ar 20 14:27:18 xavier kernel: sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed Mar 20 14:27:18 xavier kernel: end_request: I/O error, dev sda, sector 171206258 Mar 20 14:27:18 xavier kernel: Buffer I/O error on device sda9, logical block 4843970 Mar 20 14:27:19 xavier kernel: ata1: EH complete Mar 20 14:27:19 xavier kernel: sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors: (160GB/149GiB) Mar 20 14:27:19 xavier kernel: sd 0:0:0:0: [sda] Write Protect is off Mar 20 14:27:19 xavier kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 Mar 20 14:27:19 xavier kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Mar 20 14:28:07 xavier kernel: ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 Mar 20 14:28:07 xavier kernel: ata1.00: irq_stat 0x40000008 Mar 20 14:28:07 xavier kernel: ata1.00: cmd 60/80:00:5a:1e:06/00:00:0b:00:00/40 tag 0 ncq 65536 in Mar 20 14:28:07 xavier kernel: res 51/40:10:ca:1e:06/01:00:0b:00:00/40 Emask 0x409 (media error) <F> Mar 20 14:28:07 xavier kernel: ata1.00: status: { DRDY ERR } Mar 20 14:28:07 xavier kernel: ata1.00: error: { UNC } ... Thanks, I'm very worry about this. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/d2f7bef0955962945cf8aef4a147f5d1.jpg?s=120&d=mm&r=g)
On Fri, Mar 20, 2009 at 02:33:22PM -0600, Xavier Callejas wrote:
Hi,
How can I be sure that my hard disk has badblocks? How can I test all the entire disk if it has badblocks?
I'm getting this in my '/var/log/messages':
... ar 20 14:27:18 xavier kernel: sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed Mar 20 14:27:18 xavier kernel: end_request: I/O error, dev sda, sector 171206258 Mar 20 14:27:18 xavier kernel: Buffer I/O error on device sda9, logical block 4843970 Mar 20 14:27:19 xavier kernel: ata1: EH complete Mar 20 14:27:19 xavier kernel: sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors: (160GB/149GiB) Mar 20 14:27:19 xavier kernel: sd 0:0:0:0: [sda] Write Protect is off Mar 20 14:27:19 xavier kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 Mar 20 14:27:19 xavier kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Mar 20 14:28:07 xavier kernel: ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 Mar 20 14:28:07 xavier kernel: ata1.00: irq_stat 0x40000008 Mar 20 14:28:07 xavier kernel: ata1.00: cmd 60/80:00:5a:1e:06/00:00:0b:00:00/40 tag 0 ncq 65536 in Mar 20 14:28:07 xavier kernel: res 51/40:10:ca:1e:06/01:00:0b:00:00/40 Emask 0x409 (media error) <F> Mar 20 14:28:07 xavier kernel: ata1.00: status: { DRDY ERR } Mar 20 14:28:07 xavier kernel: ata1.00: error: { UNC } ...
Thanks, I'm very worry about this.
You may use badblocks(8) ... including reading the manual page *before* first usage, as you may loose data ;) On the other hand you may check the wires/cables of the disk its self (loose contact, slack joint, bends, and shielding). Werner -- "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/3b5c52cfe73181ab9556c8de48ac7805.jpg?s=120&d=mm&r=g)
On Fri, Mar 20, 2009 at 02:33:22PM -0600, Xavier Callejas wrote:
Hi,
How can I be sure that my hard disk has badblocks? How can I test all
Dr. Werner Fink wrote: the
entire disk if it has badblocks?
I'm getting this in my '/var/log/messages':
... ar 20 14:27:18 xavier kernel: sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed Mar 20 14:27:18 xavier kernel: end_request: I/O error, dev sda, sector 171206258 Mar 20 14:27:18 xavier kernel: Buffer I/O error on device sda9, logical block 4843970
As Carlos suggested, I would examine it with smartctl - this is in the smartmontools package. Query the drive SMART attributes with #smartctl -a /dev/sdx and look in particular and the reallocated sector and pending sector count. Any non zero value is bad. To run a smart test on the drive use #smartctl -t [short/long] /dev/sdx and again view the log where you will see completed tests listed. Pete -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/77cb4da5f72bc176182dcc33f03a18f3.jpg?s=120&d=mm&r=g)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2009-03-20 at 14:33 -0600, Xavier Callejas wrote:
How can I be sure that my hard disk has badblocks? How can I test all the entire disk if it has badblocks?
I'm getting this in my '/var/log/messages':
Your problem is worse than a badblock. I would look at the output of a SMART test first, or better, one using the manufacturer test utility. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAknR+cEACgkQtTMYHG2NR9U4PgCfUhSaYqv7HcwXil6rpneB+jop 50YAnRs51l15bXA6k+knEpycTb4+WhPr =Y5K2 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/27aacf61a13c66fcc083fcf8a84823bc.jpg?s=120&d=mm&r=g)
Xavier Callejas wrote:
Hi,
How can I be sure that my hard disk has badblocks? How can I test all the entire disk if it has badblocks?
I'm getting this in my '/var/log/messages':
Xavier, IMMEDIATELY copy any data you need to another disk. While there is always the potential that you just have a spurious bad block that needs to be marked as a bad block, but my experience is that after you notice the first badblock with smart, its not too much longer before the second, then third, etc... (following example of suspect drive /dev/sdb2) Save your bacon. Find a spare drive with as much space as needed to duplicate your critical data (the device with bad blocks) dd if=/dev/sdb2 of=/dev/{backup device name} To find out which bad blocks are giving problems, boot from the install DVD and choose rescue system. Then make a list of the badblocks with: /sbin/badblocks -b 4096 /dev/sdb2 >> badblocks.txt ** confirm your blocksize with dumpe2fs -h /dev/sdb2 | grep 'Block size' Then you will need to use fsck.ext3 to see if you can repair the system and add the badblocks to the badblock table: fsck.ext3 -l badblocks.txt /dev/sdb2 You can also create and add the badblocks list to the badblocks table using just the fsck.ext3 command with the -c option: fsck.ext3 -c /dev/sdb2 Good luck! -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/e1c33f61b7070765931d0219bfe6c59d.jpg?s=120&d=mm&r=g)
David C. Rankin wrote:
Save your bacon. Find a spare drive with as much space as needed to duplicate your critical data (the device with bad blocks)
dd if=/dev/sdb2 of=/dev/{backup device name}
Probably the use of dd_rescue would be more appropriate in these kind of situations. -- Rui Santos http://www.ruisantos.com/ Veni, vidi, Linux! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/77cb4da5f72bc176182dcc33f03a18f3.jpg?s=120&d=mm&r=g)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday, 2009-03-31 at 11:38 -0500, David C. Rankin wrote:
bad block, but my experience is that after you notice the first badblock with smart, its not too much longer before the second, then third, etc...
My second disk developped some badblocks a month or two after I bought it, about the end of 2001. I let it remap them, and... see: nimrodel:~ # smartctl --attributes /dev/hdb 9 Power_On_Hours 0x0032 070 070 000 Old_age Always - 26407 and: 195 Hardware_ECC_Recovered 0x001a 100 253 000 Old_age Always - 0 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 By now I don't use it for primary data, only auxiliary space. But it was my main linux disk for years with no problem. So: it depends! :-) - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAknSc6kACgkQtTMYHG2NR9UMpQCfWgywmKUED7cH//whUz6iw9g2 /9oAn0nXurcaW11Kn2kQQRhm1EUcNI60 =40c6 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/3b5c52cfe73181ab9556c8de48ac7805.jpg?s=120&d=mm&r=g)
Xavier Callejas wrote:
Hi,
How can I be sure that my hard disk has badblocks? How can I test all the entire disk if it has badblocks?
I'm getting this in my '/var/log/messages':
... ar 20 14:27:18 xavier kernel: sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed Mar 20 14:27:18 xavier kernel: end_request: I/O error, dev sda, sector 171206258 ...
Thanks, I'm very worry about this.
Hi Xavier, I would examine it with smartctl - this is in the smartmontools package. Query the drive SMART attributes with #smartctl -a /dev/sda and look in particular at the reallocated sector and pending sector count. Any non zero value is bad. To run a smart test on the drive use #smartctl -t [short/long] /dev/sda and again view the log where you will see completed tests listed. If you need to clone the drive use ddrescue #ddrescue /dev/sda /dev/new_drive logfile.txt Pete -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (6)
-
Carlos E. R.
-
David C. Rankin
-
Dr. Werner Fink
-
Pete Eby
-
Rui Santos
-
Xavier Callejas