RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 979720 - provide a --uuid command for lvchange
Summary: provide a --uuid command for lvchange
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.6
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-29 20:36 UTC by Christoph Anton Mitterer
Modified: 2013-07-02 10:06 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-01 23:55:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Christoph Anton Mitterer 2013-06-29 20:36:05 UTC
Hi.

For reasons already laid out in bug #979121... it's not that uncommon to encounter PV/VG/LVs in a system with either the same name or even worse the same UUID.

pvchange, vgchange already provide ways to alter the UUID for PVs and VGs.
But lvchange misses that for the LVs.

Please add such a option.


OT questions:
1) What LVM uses... are these real UUIDs? Cause they seem to e.g. not only use hex characters.

2) Has anyone an idea what happens in a system where PV/VG/LVs with the same UUID turn up and some of them are already active and e.g. filesystems on top of them mounted? Will that continue to work.. or does everything break?


Thanks,
Chris.

Comment 2 Zdenek Kabelac 2013-06-30 13:04:45 UTC
I guess there is some misunderstanding how the UUID works with LVs.
LV device uuid is composed from 3 pieces:

LVM-O6VNcgq5cc6en031EBx9inVszXxgOkTe3OBXO6ZhBYusjmlGOEcpkuzu1XD1WKsd

fixed prefix: LVM-
VG_uuid:      O6VNcg-q5cc-6en0-31EB-x9in-VszX-xgOkTe
LV_uuid:      3OBXO6-ZhBY-usjm-lGOE-cpku-zu1X-D1WKsd


So LV uuid needs to be unique only within the VG itself - it's valid to have same LV uuid within 2 different VGs.

Also there is no connection between filesystem and device uuid namespace.

From the system point of view - it always depends on who interprets uuid.
In case of LVM it's udev rule which creates some links.
There is no one format of UUID  (like on Windows) which would be used across whole linux system.

So IMHO there is no real reason to provide --uuid change feature for LV.
and I'd probably reject this request since it's not adding any value.

As far as the system has unique VG uuid - there could never be device with conflicting lv device uuid.

That's also a reason why lvm2 is requiring to resolve VG uuid collision - since it makes things hard to use and you get big WARNINGs for this case.

Also note that uuid for LV is only identifier which is handled within VG,
tool will refuse to store VG with duplicated LV name, and unless you
would want to put there some 'nice' letters into uuid there is not much
reason to allow to change it - but we surely advice to use  'lv names' for
this - which are nicer abbreviation for 'cryptic' uuids...

Comment 3 Christoph Anton Mitterer 2013-06-30 14:22:54 UTC
Hi Zdenek.

I see, admittedly I didn't know that the LV UUID is namespaced in the VG :)
Is this somewhere documented (and I haven't seen it) or should it be added?


So for that part I agree that technically it wouldn't be necessary to add --uuid for lvchange (but perhaps adding documentation, why this is so, if it's still missing).

There could be though some little reasons to add it (the lvchange --uuid) nevertheless:
a) There speaks nothing against having it ;-)
b) 3rd party tools may use the LV UUID (and they would encounter duplicates then)... but okay...this is actually stupid, and shouldn't be done then (when LV UUIDs are only unique within a VG)... so we rather should tell people in the manpages that LV UUIDs are unique only within an VG (and their UUIDs)... so that 3rd party tools also use both VG_UUID + LV_UUID.



I'm not sure whether I understood you with respect to the other questions, i.e. does (and how far) it break my system if I ever encounter PVs or VGs with the same UUID ... and/or VGs/LVs with the same name...
I personally see this quite often (due to cloning not only in VMs but cloning in the sense of copying whole disk images via e.g. dd)... it seems at least that the system continues to use the already active VGs/LVs and that the filesystem mountpoints upon them stay valid.


Thanks,
Chris.

Comment 4 Alasdair Kergon 2013-07-01 23:55:17 UTC
Indeed, the LV uuid is an internal LVM implementation detail and is not something over which the user has any control.

Any problems you are seeing will be due to duplicate PV or VG uuids.  There are supported ways to change those in a controlled and correct way, such as 'vgimportclone'.

Currently LVM requires that every device visible on a system has a different PV uuid and every VG has a different VG uuid.  After cloning, UUIDs should be changed immediately, using filters as necessary.

LVs in such cloned VGs should never be activated - always make the UUIDs different first.

As such, I am closing this bugzilla.  (Bug 979725 could perhaps be changed to discuss new requirements for access to cloned/guest LVs, though I think we might have a bug or two already open for that.)

Comment 5 Christoph Anton Mitterer 2013-07-02 01:41:51 UTC
Hi...

Yeah let's discuss the clone/UUID/names issues in bug #979725.


But one thing I'd like to see done here:
Is it already somewhere documented in the LVM manpages, that the LV UUIDs are only unique in combination with the VG UUIDs? At least I couldn't find it.

I think this should be added to the documentation,... as there might be 3rd party apps which (for whatever reason) use the LV UUIDs (as key or whatever)... and I shouldn't do no harm to add one or two lines to the docs which tell them about this fact :)


Cheers,
Chris.

Comment 6 Alasdair Kergon 2013-07-02 10:06:12 UTC
It's more obvious with the older lvm1 format of metadata where the ids are just 1, 2, 3, ...


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