linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Recovering PV and LG after fdisk or Repartition
@ 2007-01-03 20:48 Adam Tybor
  2007-01-04 11:18 ` [linux-lvm] " Adam Tybor
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Tybor @ 2007-01-03 20:48 UTC (permalink / raw)
  To: linux-lvm

Hi,

I made a huge mistake last night.  I was repartitioning drives in my
system using fdisk.  I accidentally fdisk the wrong drive, rebooted,
and lost my lvm2.  In light of this error, I did a dd from the
original disk to another disk of the exact same geometry before I
started trying to recover the original.

Here is what I did to try and recover.
Disk 300GB 1 partition of type 8e /dev/sdc1
It had a single volume group on the pv which was /dev/sdc1

I tried recreating the PV using the archive file, that failed.  I
forced the creation of the PV on /dev/sdc1 with the uuid from the
archive file, that succeeded.

I then ran:
vgcfgrestore -n vg-storage -t -v -f /etc/lvm/backup/vg-storage vg-storage

This worked and restored my two logical volumes.  I then activated the
volumes running vgchange -ay.  Now I cannot mount the volumes.

The two volumes had reiserfs, mount will not mount them, a dmesg shows
this error.

ReiserFS: dm-6: warning: sh-2021: reiserfs_fill_super: can not find
reiserfs on dm-6

Running reiserfsck does nothing, it just returns immediately with no output.

I tried rebuilding the super block, the tree, everything.  It seems
like reiserfsck cannot find anything.

Is there anything else I can do, I really need this data?

Thanks,

Adam

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [linux-lvm] Re: Recovering PV and LG after fdisk or Repartition
  2007-01-03 20:48 [linux-lvm] Recovering PV and LG after fdisk or Repartition Adam Tybor
@ 2007-01-04 11:18 ` Adam Tybor
  0 siblings, 0 replies; 2+ messages in thread
From: Adam Tybor @ 2007-01-04 11:18 UTC (permalink / raw)
  To: linux-lvm

> I made a huge mistake last night.  I was repartitioning drives in my
> system using fdisk.  I accidentally fdisk the wrong drive, rebooted,
> and lost my lvm2.  In light of this error, I did a dd from the
> original disk to another disk of the exact same geometry before I
> started trying to recover the original.


Just an update, after quotes upwards of $5,000 I decided to call in my
own big guns.  I had one of my friends come over and take a peek.
Within 2 hours he put me in a process to fix the data.

Turns out that metadata which should have resided on sdc1 was actually
at sdc.  This was found after several dd dumps and hexdiffs and the
like.  We were comparing the corrupted disk to good disks which is how
we found the problem.

Lets just say that vgscan
-dvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv provides some very
detailed info which led him in the right direction.

We added new disk, sdb, partitioned it like the previous disk. Then
moved some bits.

dd if=/dev/sdc bs=512 count=6000 of=/dev/sdb1

Upon doing this vgscan found the volume group metadata, but could not
load the vg.  On a side note, using a bs higher than 512 did not work.

Inspecting the logs vgscan found the label at sector 1 but expected it
at sector 2.  Simply adding skip=1 to the dd above did the trick.  The
volume group came up, reiserfs was in shambles, only 3MB of its 100GB
were there, but it was progress :)

Running a final dd of the 130GB of the previous lvm group did the trick.

I am currently copying files off the drive onto another one.  Reiserfs
complains about a couple things, I will need to run a --rebuild-tree
to get at some data, I just want this stuff off of here as soon as
possible.

Cheers,
Adam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-04 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-03 20:48 [linux-lvm] Recovering PV and LG after fdisk or Repartition Adam Tybor
2007-01-04 11:18 ` [linux-lvm] " Adam Tybor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).