No recent backup or lvm snapshot? (And is so easy to get LVM snapshots for backups in LVM...)
You lost the hooks into to the PV...but instead of looking at it first to see if you could remount it or rescue it as an LVM, you started tryng to write to it as a physical device. So, I don't know if you corrupted it further by doing that prematurely.
Also. I'm not sure what you are seeing from the LiveCD by saying you "can see it"... so you are going to have to decide on the recovery strategy based on what is still there/if you decide to try to recover, remembering that you may not be successful. You tried to recover it by other means, before trying to recover it as LVM first...
I guess the first thing to do would be to check that the partition sda5 is intact. If so then start LVM up from the LiveCD:
Code:
/etc/init.d/lvm start
Then assess what errors you have at what levels via
Code:
lmscan
lgscan
pvscan
Most of the time in LVM, you lose a member of a group or a physical volume of the PV, where you sometimes you can re-add or recreate those pieces.... There's different ways to go, based on what happened, so I can't just recommend or blurt out- do this and you'll be fixed. I looked at your post last night and the pastebin... I had to step away and think about what I would do.
Taking what you did already. Taking that info into consideration... From the wiki:
LVM keeps a metadata header at the start of every physical volume, each of which is uniquely identified by a UUID. Each PV's header is a complete copy of the entire volume group's layout, including the UUIDs of all other PVs, the UUIDs of all logical volumes and an allocation map ofPEs to LEs. This simplifies data recovery in the event of PV loss.
Since you tried to write to it physically, if it where me arriving on the scene, the first thing I would do is do:
Code:
dd if=/dev/sda5 bs=512 count=255 skip=1 of=/tmp/sda5.txt
That will capture the start of the PV. I would then need to look at that extract with a hex editor. The start of the extract is going to be binary junk that I don't need (Not the file yet). The header file is ascii text. I would see something similar to this at the start of that ascii header file:
Code:
VolGroupLVM2_member {
id="u0GDKW-2WMH-eHwx-fai7-144H-NYuR-Mi2h04"
It goes on until after the "logical_volume" def. That def ends after the four "}" bracket characters, closing/ending that def. I would extract that info and save to a file called /etc/lvm/backup/VolGroupLVM2_member...
If that file info is intact, good job and I could use it to bring it back up. If that file itself is over-written so I cannot see what the valid UID's, sizes and particulars of the LVM definition, then everything else is very hard work to try to re-create it and all the odds of recovery are against me.
Just saying.
Bookmarks