copying a disk with ignoring errors

Mark Terribile materribile at yahoo.com
Fri Jan 8 08:45:04 UTC 2010


> On Tue, Jan 05, 2010 at 03:31:46PM +0100, Christoph Kukulies wrote:
>> I recall a case when I had a hard disk that had got bad sectors and
>> it wasn't accessible through normal mounting anymore.
>> Then a tool came into the game that - I believe - Poul Henning had
>> recommended or written for this purpose.
>>
>> It copies a disk sector by sector to a file (kind of dd), but
>> ignores errors, it just skips sectors it couldn't read (after a
>> couple
>> of retries). The result was, that one had a - albeit - worm-eaten -
>> image of the disk allowing to access the filesystem
>> and getting to the important files with a little luck these not
>> being amongst the corrupted data.
>>
>> Anyone knowing what this little tool was named? Something like
>> diskcopy, devcopy, I forgot.
>>
>> --
>> Christoph
>
> dd conv=noerror?

I recently had an episode with a failing hard drive.  Normal file system
operation couldn't read certain sectors, but reading the whole disk
linearly (dd if=/dev/adxxxx bs=bbbb) did work.  Since larger drives are now
cheaper, I set up a file system on a new BIG drive, copied the slices out
to files on it, then made those files into memory disks, mounted them, and
copied the contents off.  I had to experiment a bit to find a blocksize
that worked.  I believe it was a smallish power of two in sectors.

It might be worth a try.

I've also recovered SCSI drives that developed bad sectors by writing
specifically those sectors, as you are trying to do.  Whether it fixed a
bad write (perhaps due to a powerfail while writing?) or it caused the
drive to remap the sector I don't know.  I do know that most of my hardware
cursing over the last two years has been due to disk drive power
connectors, which seem to work reliably just once.  If you move anything
you take your data's safety in your hands when you reconnect.  SATA's
power connectors are the answer to a prayer.


      


More information about the freebsd-questions mailing list