[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smartmontools-support
Subject:    [smartmontools-support]don't try this at home ... writing zeros back to error blocks with dd
From:       "Gary Funck" <gary () intrepid ! com>
Date:       2005-07-14 2:36:32
Message-ID: HLEPJEEBEKBMAHLBCNMMOEBACEAA.gary () intrepid ! com
[Download RAW message or body]



Got to thinking about recovering blocks that have uncorrectable errors,
with a few simple commands.  Here's an idea.  Assume /dev/hdc is the
drive with the UNC and it has a single partition /dev/hdc1.

first recover what we can:

e2fsck -c /dev/hdc1

Then read each sector back, and if it has an error write back a zero block

dd if=/dev/hdc of=/dev/hdc conv=noerror,sync bs=512

NOTE/WARNING: I DON'T KNOW IF THIS WORKS.  I HAVE NOT TRIED IT.
For discussion purposes only.

If I understand dd correctly, it will read a block from /dev/hdc and write
the same block back to /dev/hdc.  However, if it encounters an error,
it will write a zero block instead.

After this pass, I'd run e2fsck again:

e2fsck -c /dev/hdc1




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Smartmontools-support mailing list
Smartmontools-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/smartmontools-support
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic