Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Accessing Duplicate LVM2 VolumeGroups
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
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Tue Aug 14, 2007 10:29 am    Post subject: Accessing Duplicate LVM2 VolumeGroups Reply with quote

I removed a drive with LVM2 and re-installed another drive with LVM2.

I wish to access the volumes from the old drive and I'm using an external usb caddy. I have two duplicate VolumeGroup00 entries and I can see no way to access or rename the old VolumeGroup00

Code:
lvm> vgscan
  Reading all physical volumes.  This may take a while...
  WARNING: Duplicate VG name VolGroup00: Existing WSTzAK-sgEc-de0j-S2Ia-GMVd-Rv2k-y6VWbB (created here) takes precedence over p2qSKr-tMC3-2YPE-SoP9-mFFt-2oCA-gmmR4w
  Found volume group "VolGroup00" using metadata type lvm2
  Found volume group "VolGroup00" using metadata type lvm2

lvm> vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                128
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               24.69 GB
  PE Size               32.00 MB
  Total PE              790
  Alloc PE / Size       789 / 24.66 GB
  Free  PE / Size       1 / 32.00 MB
  VG UUID               p2qSKr-tMC3-2YPE-SoP9-mFFt-2oCA-gmmR4w

  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                128
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               43.12 GB
  PE Size               32.00 MB
  Total PE              1380
  Alloc PE / Size       1379 / 43.09 GB
  Free  PE / Size       1 / 32.00 MB
  VG UUID               WSTzAK-sgEc-de0j-S2Ia-GMVd-Rv2k-y6VWbB


Suggestions?
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Tue Aug 14, 2007 11:12 am    Post subject: Reply with quote

man vgrename.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Tue Aug 14, 2007 12:17 pm    Post subject: Reply with quote

Yes I appreciate there is a man page for the lvm tools. Although when I try to do that it suggests I need to distinguish between them using UUID but the man page or the vgrename tool gives no hint how this is achieved.
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Tue Aug 14, 2007 12:28 pm    Post subject: Reply with quote

Oh, sorry, should have been more verbose. ;) What if you try

Code:
vgrename /dev/disk/by-uuid/your_another_uuid some_other_name
(try that with your own responsibility, I've actually not done that before!)

... or unplug the other drive, rename the volume group and then plug in the another drive again?
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Tue Aug 14, 2007 2:27 pm    Post subject: Reply with quote

Again that would be ok but /dev/disk/by-uuid doesn't contain VG UUIDs.

Although the vgrename hints at using uuid there appears to be no way of it handling them.

There appears to be a gap here in the userspace utils for LVM2!

Oh! btw I removed the new drive replaced with the old and then booted with a livecd to rename the VolGroup00 to VG00, now it's lost my volumes LOL.
Back to top
View user's profile Send private message
manaka
Apprentice
Apprentice


Joined: 23 Jul 2007
Posts: 178
Location: Spain

PostPosted: Tue Aug 14, 2007 2:46 pm    Post subject: Reply with quote

I faced a similar problem some time ago. I used the method described in http://www.linuxjournal.com/node/8874/print. It worked for me.

Basically the trick is to use vgcfgrestore to rewrite the volume group name.

Good luck...
_________________
Javier Miqueleiz

"Listen to your heart. It knows all things, because it came from the Soul of the World, and it will one day return there."
Back to top
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Tue Aug 14, 2007 3:13 pm    Post subject: Reply with quote

Thanks for the link to the article.

Looks like having lost the metadata to the old drive I've lost the volumes, which were only swap and / fortunately I had made a backup of the data before hand.

I'm still concerned that there appears to be no means of handling Volume Group names where they are identical even though a VG UUID exists which could provide a mechanism to handle this situation.
Back to top
View user's profile Send private message
manaka
Apprentice
Apprentice


Joined: 23 Jul 2007
Posts: 178
Location: Spain

PostPosted: Wed Aug 15, 2007 5:48 am    Post subject: Reply with quote

Yes... The VG UUID could be used to differentiate between 2 VGs with the same name.

But you would have a device names issue. If both VGs have a LV named "root", how should the devices be named?
_________________
Javier Miqueleiz

"Listen to your heart. It knows all things, because it came from the Soul of the World, and it will one day return there."
Back to top
View user's profile Send private message
echo6
Guru
Guru


Joined: 04 Jan 2003
Posts: 587

PostPosted: Wed Aug 15, 2007 6:15 am    Post subject: Reply with quote

manaka wrote:
If both VGs have a LV named "root", how should the devices be named?
Surely that shouldn't be an issue.

e.g. If I have a VolGroup00 with a VG uuid of p2qSKr-tMC3-2YPE-SoP9-mFFt-2oCA-gmmR4w and
VolGroup00 with a VG uuid of WSTzAK-sgEc-de0j-S2Ia-GMVd-Rv2k-y6VWbB

Then the could appear as /dev/mapper/VolGroup00-p2qSKr-tMC3-2YPE-SoP9-mFFt-2oCA-gmmR4w and
/dev/mapper/VolGroup00-WSTzAK-sgEc-de0j-S2Ia-GMVd-Rv2k-y6VWbB and so on and according to the LVM metadata each of the logical volumes also have uuids.
Back to top
View user's profile Send private message
manaka
Apprentice
Apprentice


Joined: 23 Jul 2007
Posts: 178
Location: Spain

PostPosted: Wed Aug 15, 2007 11:53 am    Post subject: Reply with quote

Well... I meant it was an issue from a user/system administratror view... The device names would become rather unfriendly...

But as you point out, it could be done, of course... :)
_________________
Javier Miqueleiz

"Listen to your heart. It knows all things, because it came from the Soul of the World, and it will one day return there."
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