Writing to bad sector makes every other operation fail afterwards

0

My hard drive has a few bad blocks, so I'm trying to get a list of them all in order to bypass them when creating a new ext4 filesystem, like this:

badblocks -wsv -o badblocks_sdf.txt /dev/sdf

As soon as it actually hits a bad block, every other block after that fails.

My syslog is filled with these messages:

[91197.287574] blk_update_request: I/O error, dev sdf, sector 4563147104
[91202.286344] scsi_io_completion: 126841 callbacks suppressed
[91202.286352] sd 3:0:0:0: [sdf] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[91202.286360] sd 3:0:0:0: [sdf] tag#0 CDB: Read(16) 88 00 00 00 00 01 0f ff f8 50 00 00 00 08 00 00
[91202.286362] blk_update_request: 126841 callbacks suppressed
[91202.286364] blk_update_request: I/O error, dev sdf, sector 4563400784
[91202.286956] sd 3:0:0:0: [sdf] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[91202.286962] sd 3:0:0:0: [sdf] tag#0 CDB: Read(16) 88 00 00 00 00 01 0f ff f8 50 00 00 00 08 00 00

Is that expected behaviour, can something be done about it?

skerit

Posted 2016-09-14T21:39:46.310

Reputation: 746

It seems logical you should be reading each sector to determine the bad sectors instead of wrtitting – Ramhound – 2016-09-14T23:22:50.747

Answers

2

Modern hard drives utilize S.M.A.R.T technologies and are supposed to reallocate "bad blocks" so they do not appear in the filesystem. If that mechanism has failed and you encounter what is supposed to be a reallocated sector, the drive, effectively, blows its cookies and, in many cases, becomes innaccessible until the power has been cycled on the drive. The other thing we used to see, back in the early 1990's, was a bad sector id. Every sector has an id byte which is requested by the operating system and, if you requested that sector, the drive would lock up because it couldn't find it. Either one is almost impossible to identify as the specific cause; but, it's not uncommon for me to have to do a clone from the beginning to the error and then a second run from the end backwards while doing data recovery. Either way, you should not trust that drive and I sure hope you don't put anything on it you care about.

DavisMcCarn

Posted 2016-09-14T21:39:46.310

Reputation: 66

I actually thought about using it as an extra parity drive for Snapraid – skerit – 2016-09-16T09:08:53.757