Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fix lost vgda on lvm *FIXED*
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
oizone
n00b
n00b


Joined: 11 Feb 2004
Posts: 55
Location: Finland

PostPosted: Fri Aug 13, 2004 10:26 am    Post subject: fix lost vgda on lvm *FIXED* Reply with quote

I have a lvm volumegroup with 5 physical volumes 3x80gb and 2x160gb.
A couple of days ago I was creating a raid5 array on a another machine and at one point I accidently were on the machine with the lvm and destroyed the partitions on the 160gb disks. I know, I know, that was stupid :oops:

The lvm array used to be on a another machine and I have the lvm autobackup on that machine, can I use that to restore the vgda to the disks?
if yes do the disks need to be in same device nodes as they were when the backup was taken? Or how does it know which UUID to assign to which disk?

hopefully some can help me so that I won't lose all the 550gb just because of my own stupidity... :cry:


Last edited by oizone on Tue Aug 17, 2004 6:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
oizone
n00b
n00b


Joined: 11 Feb 2004
Posts: 55
Location: Finland

PostPosted: Tue Aug 17, 2004 6:35 pm    Post subject: Reply with quote

Ok, so I got this finally fixed.

After some googling and posting messages here and redhat lvm mailing lists I got no help and decided to do some testing of my own and got it working again.

Here's how I got it working:

First I deleted the partitions that I accidently created on the 160gb drives and then I ran pvcreate again on them to re-create the pvs.
Then I dumped the beginning of the disks from the still functional disks and looked how the UUID is stored there. I noticed that the first 315bytes were identical on all the pvs except for the UUID so I dumped it to a file from a working disk
Code:

dd if=/dev/hdb of=/tmp/hdb bs=315 count=1

then I looked from the lvm's error message what was the UUID of the missing disk and just used emacs to change the UUID to the /tmp/hdb file.

Then I just dumped the modified UUID to the corrupt disk
Code:

dd if=/tmp/hdb of=/dev/sda bs=315 count=1


After this I still had to restore the vgda backup to the disk because the disk still thought that it was disk #1 in the vg
Code:

vgcfgrestore -n movievg /dev/sda


after doing this to both the corrupt disks the vg started working normally just by doing
Code:

vgscan
vgchange -ay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum