[linux-lvm] recover data from a pv that has first 4k damaged?

Brian J. Murrell brian at interlinx.bc.ca
Wed Jul 28 06:01:42 UTC 2004


I sure was hoping I would never be one of those posting here with a
"help, my volume group has fallen and it can't get up" messages.  But
the the time has come and the hard disk Grimm Reaper is standing over

I have the following set up:

IDE0 Master: hda1: ext3 /boot
             hda2: PV 1/2 of a single VG, but empty/unused
IDE1 Master: hdc:  PV 2/2 of the same single VG

So all data is on hdc, which is the 2nd "part" of a 2 part VG.  The
first part (hda2) is completely unused (because that disk sucks in terms
of performance).

Now for some reason, the first 4k (exactly 4096 bytes) of hdc is
unreadable.  It gives up all kinds of errors trying to read it.  However
I can read from 4096 bytes and beyond (dd if=/dev/hdc bs=4096 skip=1)
just fine.

hdc is large.  80GB or 160GB, I don't remember, and currently we are not
using but a few GB of it, so I am copying the first 20GB of the disk to
a spare 20GB HD here in my workstation, including 4096 empty bytes at
the beginning of the target disk:

(dd if=/dev/zero bs=4096 count=1 && dd if=/dev/hdc bs=4096 skip=1) |
ssh root at pc "dd of=/dev/hdc bs=1024k"

so that everything lines up, block offset wise.

Remember hda seems to be fine.  hdc is the one in trouble.

What can I do to get as much data off of hdc as possible?  Presumably if
I can get the lvm metadata back on it (the 20GB disk where there will be
no read errors in the 4096 bytes) and fsck (or debugfs) the filesystems,
only a few files (hopefully system binaries, etc. -- easily restorable)
will be damaged.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20040728/545b8cca/attachment.sig>

More information about the linux-lvm mailing list