Bug 1479084
| Summary: | vgcfgbackup does not save the PV metadata size originally specified by --metadatasize | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | bugzilla |
| Component: | lvm2 | Assignee: | LVM and device-mapper development team <lvm-team> |
| lvm2 sub component: | LVM Metadata / lvmetad | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | unspecified | CC: | agk, cmarthal, heinzm, jbrassow, lmiksik, mcsontos, msnitzer, prajnoha, prockai, rbednar, zkabelac |
| Version: | 7.3 | Keywords: | FutureFeature |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.175-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 15:20:44 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
bugzilla
2017-08-07 22:10:13 UTC
Please would you attach a (compressed?) copy of the actual backup file you're restoring from? If there's anything you want to hide (like LV names) in it, please overtype those characters keeping the number of characters everywhere the same. (eg 'hideme' -> 'lvol01') (If the compressed file is too big, upload it somewhere and post a link.) I've reproduced something similar. (In reply to Alasdair Kergon from comment #3) > I've reproduced something similar. Does that mean you do not need the upload? --restorefile file
In conjunction with --uuid, this extracts the location and size
of the data on the PV from the file (produced by vgcfgbackup)
and ensures that the metadata that the program produces is con-
sistent with the contents of the file i.e. the physical extents
will be in the same place and not get overwritten by new meta-
data. This provides a mechanism to upgrade the metadata format
or to add/remove metadata areas. Use with care. See also vgcon-
vert(8).
So it is doing what it says it does, but if you don't specify the metadata size to use, it would make sense for it to use up the space right up to pe_start, making it similar in size to the original one.
(In reply to bugzilla from comment #4) > (In reply to Alasdair Kergon from comment #3) > > I've reproduced something similar. > > Does that mean you do not need the upload? No, I was thinking at first it was a rounding error depending on the precise sizes in the calculations, but it wasn't even trying to get this right! Also problems with pvcreate -ff remembering bootareas instead of paying attention only to the new command line and restorefile contents. Pushed some patches upstream so it clears existing boot areas and uses the maximum size for the metadata area that fits. There are still more bugs to fix (eg. if the number of mda copies is changed from 1 to 2). I think the upstream patches are sufficient to trap these cases earlier now. Verified.
BEFORE PATCH:
lvm2-2.02.171-8.el7
# pvcreate --metadatasize 128MiB /dev/sda1
Physical volume "/dev/sda1" successfully created.
# vgcreate VG /dev/sda1
Volume group "VG" successfully created
# vgcfgbackup VG
Volume group "VG" successfully backed up.
# pvs -o pv_mda_free,pv_mda_size /dev/sda1
PMdaFree PMdaSize
<68.00m <136.00m
# pvs --noheadings -o pv_uuid /dev/sda1
SE2Etx-b7io-smJ2-HWN7-LFeK-fqYD-OC1Z1B
# pvcreate -ff --uuid SE2Etx-b7io-smJ2-HWN7-LFeK-fqYD-OC1Z1B --restorefile /etc/lvm/backup/VG /dev/sda1
Really INITIALIZE physical volume "/dev/sda1" of volume group "VG" [y/n]? y
WARNING: Forcing physical volume creation on /dev/sda1 of volume group "VG"
Physical volume "/dev/sda1" successfully created.
# pvs -o pv_mda_free,pv_mda_size /dev/sda1
PMdaFree PMdaSize
<4.00m <8.00m
AFTER PATCH:
lvm2-2.02.176-5.el7
# pvcreate --metadatasize 128MiB /dev/sda1
Physical volume "/dev/sda1" successfully created.
# vgcreate VG /dev/sda1
Volume group "VG" successfully created
# vgcfgbackup VG
Volume group "VG" successfully backed up.
# pvs -o pv_mda_free,pv_mda_size /dev/sda1
PMdaFree PMdaSize
<68.00m <136.00m
# pvs --noheadings -o pv_uuid /dev/sda1
rd1HNX-GrtZ-dxSM-HrDy-vwXi-u8E4-HrzbT8
# pvcreate -ff --uuid rd1HNX-GrtZ-dxSM-HrDy-vwXi-u8E4-HrzbT8 --restorefile /etc/lvm/backup/VG /dev/sda1
Really INITIALIZE physical volume "/dev/sda1" of volume group "VG" [y/n]? y
WARNING: Forcing physical volume creation on /dev/sda1 of volume group "VG"
Physical volume "/dev/sda1" successfully created.
# pvs -o pv_mda_free,pv_mda_size /dev/sda1
PMdaFree PMdaSize
<68.00m <136.00m
3.10.0-811.el7.x86_64
lvm2-2.02.176-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017
lvm2-libs-2.02.176-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017
lvm2-cluster-2.02.176-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017
lvm2-python-boom-0.8.1-5.el7 BUILT: Wed Dec 6 11:15:40 CET 2017
cmirror-2.02.176-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017
device-mapper-1.02.145-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017
device-mapper-libs-1.02.145-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017
device-mapper-event-1.02.145-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017
device-mapper-event-libs-1.02.145-5.el7 BUILT: Wed Dec 6 11:13:07 CET 2017
device-mapper-persistent-data-0.7.3-3.el7 BUILT: Tue Nov 14 12:07:18 CET 2017
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/RHEA-2018:0853 |