Description of problem: This is more of an enhancement request: I tried to connect a disk that had previously been a root disk in a FC6 box to my own FC6 box. I connected it via USB. But I could not access the root partition of the external disk as its volume group had the same name as my own box, i.e. VolGroup00, and there was no way to rename it. I had to disconnect my own root disk, boot from a LiveCD, connect the external disk, use vgrename to rename the volume group, power down and reconnect my own root disk and power up again to come around this. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: vgrename (and possibly other commands) should be able to take the UUID as an argument Additional info:
vgrename accepts the UUID (since 2.02.03) but this is only mentioned in an error message (and bugzilla, mailing lists etc.) "Found more than one VG called %s. Please supply VG uuid."
As I am reading more about problems moving drives between computers, it could be a great idea to generate a random ID for the VG/LV names on creation with the option of entering a VG/LV name of choice. This would solve the problem of taking a drive from computer 'A' with an auto generate VG/LV name and putting in a computer 'B' that ends up with the same name due to default install parameters. A random name/number would limit this name conflict quite drastically.
Simple fix to man pg posted. Not sure about the last comment. The names should be human-readable. If we put random #'s in there, it somewhat defeats this purpose. Perhaps the problem you describe probably is best solved another way.
lvm2-2.02.16-3.el5.i386 vgrename does not act on the UUID parameter eg: /dev/hda2 has UUID oFMywY-Ge7Q-v8X1-4vc3-Tkf0-0Fk8-mtV9F8 /dev/hdc2 has UUID PK5pME-nIaB-ein8-HyZu-GQsj-mq1g-Ky87Pk Both have the same volume group name: VG00 bash# vgrename -v PK5pME-nIaB-ein8-HyZu-GQsj-mq1g-Ky87Pk VGTest Checking for existing volume group "PK5pME-nIaB-ein8-HyZu-GQsj-mq1g-Ky87Pk" WARNING: Duplicate VG name VG00: Existing oFMywY-Ge7Q-v8X1-4vc3-Tkf0-0Fk8-mtV9F8 (created here) takes precedence over PK5pME-nIaB-ein8-HyZu-GQsj-mq1g-Ky87Pk Fixing up missing format1 size (93.06 GB) for PV /dev/hdc2 Volume group "VG00" still has active LVs Looks like it requires a forced rescue disk boot.
> Volume group "VG00" still has active LVs It won't let you rename a volume group that has active LVs. That check got fixed in 2.02.22: it was checking for active LVs in either of the VGs rather than just in the one VG about to be renamed.
2.02.23 rather
lvm2-2.02.46-8.el5 I have added one more disk(/dev/sdb) to the machine to copy few data from this disk to my local disk. [root@localhost /]# fdisk -l Disk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 1305 10377990 8e Linux LVM Disk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 * 1 13 104391 83 Linux /dev/sdb2 14 1305 10377990 8e Linux LVM [root@localhost /]# pvs Found duplicate PV cKjpYCRm6kg9OVvXd7HHMQ8hpKqLC6Up: using /dev/sdb2 not /dev/sda2 PV VG Fmt Attr PSize PFree /dev/sdb2 VolGroup00 lvm2 a- 9.88G 0 Again it is scenario of duplicate VG name. But from vgdisplay i can't find two VGname with different UUID. so that i can rename one of them. [root@localhost /]# vgdisplay Found duplicate PV cKjpYCRm6kg9OVvXd7HHMQ8hpKqLC6Up: using /dev/sdb2 not /dev/sda2 --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 9.88 GB PE Size 32.00 MB Total PE 316 Alloc PE / Size 316 / 9.88 GB Free PE / Size 0 / 0 VG UUID bWTMz2-v2Q1-CYzp-vLVy-SFF7-2UjV-cBufv3 how can i see the contents of my newly attached disk? [root@localhost /]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.4
That is a duplicate PV uuid - you must use pvchange -u /dev/sdb2 on the new device to have LVM recognize it as a unique device. LVM cannot use device names so it first checks each device for a PV UUID and starts the grouping based on what it finds. If it finds duplicate PV UUIDs, it stops with this message. In any case, this is a bz is about the UUID missing from the vgrename man page. The man page has been fixed upstream for a long time. Closing this bz. If you have further issues please file a different bz for them or email lvm-devel. Thanks.