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 1503061 - Update 'vgexport' man page to add more info about benefit of using 'vgexport' during migration of VG form one system to other
Summary: Update 'vgexport' man page to add more info about benefit of using 'vgexport'...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.5
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1477664 1546181
TreeView+ depends on / blocked
 
Reported: 2017-10-17 09:41 UTC by Milan P. Gandhi
Modified: 2021-09-03 12:48 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.178-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 11:02:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3193 0 None None None 2018-10-30 11:03:23 UTC

Description Milan P. Gandhi 2017-10-17 09:41:45 UTC
RHEL LVM documentation describes below steps to migrate a volume group from one system to another:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/VG_move.html

The steps in above link suggests to use "vgexport" to export the volume group after deactivating it with "vgchange -an" command.

Couple of users had a query about what is a significance of using "vgexport" after deactivating the vg with "vgchange -an" command? since deactivation of the volume group would prevent any access to the lvm volumes present in it.

The users had also checked the man page of "vgexport" but were unable to find more information about significance of using "vgexport" after deactivating the volume group.


So, this BZ is filled to add some more information to the man page of "vgexport" to provide some more information about how doing vgexport before a volume group migration could help to avoid accidental access to the vg and benefit of using vgexport.

I have a suggestion to add a summary similar to the one below to man page of "vgexport" to provide more information on benefit of vgexport:


----8<----
Once the volume group is in exported state, any accidental attempt to activate the volume group or lvm volumes present in it would fail with an error.

While migrating the physical volumes, volumes groups from one system to another, once the volume group is de-activated, there is still a risk that any scheduled backup jobs, automation scripts, or applications which are configured to use specific lvm volume/volume group may try to access the volume group when it is in de-activated state. It may also try to activate the volume group.

And if the volume group accidentally gets activated during migration process, then it could lead to lvm, filesystem metadata corruption.

To avoid any chances of above risk, we could export the volume group from system before a migration. It would prevent any further access or changes in the volume group.

For example, an attempt to re-activate the volume group or lvm volumes in exported vg fails with following error:


	[root@testhost ~]# vgchange -an vg1
	  Volume group "vg1" is exported		<---
	[root@testhost ~]# 
	[root@testhost ~]# lvchange -ay vg1/lv1
  	  Volume group vg1 is exported
	[root@testhost ~]# 
	[root@testhost ~]# 

    Accidental removal of PV from VG also fails with similar error:

	[root@testhost ~]# vgreduce vg1 /dev/mapper/mpatha
	  Volume group vg1 is exported
	  Cannot process volume group vg1
	  Failed to find physical volume "/dev/mapper/mpatha".


Once the volume group is exported from system, it would be available on any system only after re-importing it. Thus it would add an additional layer of security for volume group when it is being migrated from one system to other. It would prevent the volume group from activation or any accidental changes.
----8<----

Version-Release number of selected component (if applicable):
lvm2-2.02.130-5.el7.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Milan P. Gandhi 2017-11-23 09:39:15 UTC
upstream patch for update to vgexport man page:
https://www.redhat.com/archives/lvm-devel/2017-November/msg00077.html

Comment 7 Roman Bednář 2018-07-20 13:22:00 UTC
Verified with latest rpms.

Comment 9 errata-xmlrpc 2018-10-30 11:02:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3193


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