Bug 240529 - vgrename using UUID missing from man page
Summary: vgrename using UUID missing from man page
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2   
(Show other bugs)
Version: 6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Alasdair Kergon
QA Contact: Corey Marthaler
Keywords: Reopened
Depends On:
TreeView+ depends on / blocked
Reported: 2007-05-18 09:12 UTC by Markus Lindholm
Modified: 2010-03-22 16:38 UTC (History)
6 users (show)

Fixed In Version: 2.02.26
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-03-22 16:38:41 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Markus Lindholm 2007-05-18 09:12:23 UTC
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:
Actual results:

Expected results:
vgrename (and possibly other commands) should be able to take the UUID as an

Additional info:

Comment 1 Alasdair Kergon 2007-05-18 11:46:17 UTC
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."

Comment 2 Robin 2007-05-18 17:01:48 UTC
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.

Comment 3 Dave Wysochanski 2007-05-21 21:06:35 UTC
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.

Comment 4 Subhendu Ghosh 2007-06-03 08:41:37 UTC

vgrename does not act on the UUID parameter
/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
    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.

Comment 5 Alasdair Kergon 2007-06-03 08:51:22 UTC
> 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.

Comment 6 Alasdair Kergon 2007-06-03 08:52:06 UTC
2.02.23 rather

Comment 7 kaushik 2010-03-19 16:14:37 UTC

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

Comment 8 Dave Wysochanski 2010-03-22 16:38:41 UTC
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@redhat.com.  Thanks.

Note You need to log in before you can comment on or make changes to this bug.