Bug 1890299
| Summary: | pvck dump and repair assume the first mda is always at 4096 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | David Teigland <teigland> |
| Component: | lvm2 | Assignee: | David Teigland <teigland> |
| lvm2 sub component: | Command-line tools | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | high | CC: | agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, nyewale, prajnoha, thornber, zkabelac |
| Version: | 8.3 | Flags: | pm-rhel:
mirror+
|
| Target Milestone: | rc | ||
| Target Release: | 8.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.03.11-0.2.20201103git8801a86.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-05-18 15:02:04 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
David Teigland
2020-10-21 20:33:33 UTC
pushed to master https://sourceware.org/git/?p=lvm2.git;a=commit;h=c96645781ceb88c625dfae73e5baa08f1ce0e07e Have not found a way to really test this on a machine with non-4k page size, but forced lvm to use a 64k page size to test it. Just an update that this bug is waiting on the fix bug 1917920 before final verification. The '--dump headers' and '--dump metadata' both "work" when in finding the mda when a VG is present. However '--dump metadata' doesn't when a VG isn't present, but it appears nothing really happens with a PV not in a VG on an 4k page machine either. # ppc64le machine kernel-4.18.0-268.el8 BUILT: Mon Dec 28 03:47:31 CST 2020 lvm2-2.03.11-1.el8 BUILT: Fri Jan 8 05:20:47 CST 2021 lvm2-libs-2.03.11-1.el8 BUILT: Fri Jan 8 05:20:47 CST 2021 [root@p8-224-node1 ~]# getconf PAGESIZE 65536 [root@p8-224-node1 ~]# pvscan PV /dev/sda3 VG rhel_p8-224-node1 lvm2 [13.99 GiB / 0 free] PV /dev/mapper/mpatha1 lvm2 [<52.50 GiB] PV /dev/mapper/mpatha2 lvm2 [<52.50 GiB] Total: 3 [118.99 GiB] / in use: 1 [13.99 GiB] / in no VG: 2 [<105.00 GiB] # This doesn't seem right? [root@p8-224-node1 ~]# pvck --dump metadata /dev/mapper/mpatha1 CHECK: pv_header.disk_locn[2].offset expected 4096 # for first mda Found bad header or metadata values. [root@p8-224-node1 ~]# pvck --dump headers /dev/mapper/mpatha1 label_header at 512 label_header.id LABELONE label_header.sector 1 label_header.crc 0xb5239dca label_header.offset 32 label_header.type LVM2 001 pv_header at 544 pv_header.pv_uuid Y4YlzlYEjzfsTsCQ39OQgaTJfCqymH2m pv_header.device_size 56371425280 pv_header.disk_locn[0] at 584 # location of data area pv_header.disk_locn[0].offset 33558016 pv_header.disk_locn[0].size 0 pv_header.disk_locn[1] at 600 # location list end pv_header.disk_locn[1].offset 0 pv_header.disk_locn[1].size 0 pv_header.disk_locn[2] at 616 # location of metadata area pv_header.disk_locn[2].offset 65536 pv_header.disk_locn[2].size 33492480 CHECK: pv_header.disk_locn[2].offset expected 4096 # for first mda pv_header.disk_locn[3] at 632 # location list end pv_header.disk_locn[3].offset 0 pv_header.disk_locn[3].size 0 pv_header_extension at 648 pv_header_extension.version 2 pv_header_extension.flags 0 pv_header_extension.disk_locn[0] at 656 # location list end pv_header_extension.disk_locn[0].offset 0 pv_header_extension.disk_locn[0].size 0 mda_header_2 at 65536 # metadata area mda_header_2.checksum 0xf9229e2e mda_header_2.magic 0x204c564d3220785b35412572304e2a3e mda_header_2.version 1 mda_header_2.start 65536 mda_header_2.size 33492480 mda_header_2.raw_locn[0] at 65576 # commit mda_header_2.raw_locn[0].offset 0 mda_header_2.raw_locn[0].size 0 mda_header_2.raw_locn[0].checksum 0x0 mda_header_2.raw_locn[0].flags 0x0 mda_header_2.raw_locn[1] at 65600 # precommit mda_header_2.raw_locn[1].offset 0 mda_header_2.raw_locn[1].size 0 mda_header_2.raw_locn[1].checksum 0x0 mda_header_2.raw_locn[1].flags 0x0 Found bad header or metadata values. [root@p8-224-node1 ~]# vgcreate VG /dev/mapper/mpatha1 Volume group "VG" successfully created [root@p8-224-node1 ~]# pvck --dump metadata /dev/mapper/mpatha1 CHECK: pv_header.disk_locn[2].offset expected 4096 # for first mda metadata text at 66048 crc 0x78cb18c7 # vgname VG seqno 1 --- VG { id = "vfnNHd-Tf5F-aIdX-U5oc-ivP2-lxA3-UOSFsg" seqno = 1 format = "lvm2" status = ["RESIZEABLE", "READ", "WRITE"] flags = [] extent_size = 8192 max_lv = 0 max_pv = 0 metadata_copies = 0 physical_volumes { pv0 { id = "Y4Ylzl-YEjz-fsTs-CQ39-OQga-TJfC-qymH2m" device = "/dev/mapper/mpatha1" status = ["ALLOCATABLE"] flags = [] dev_size = 110100440 pe_start = 65543 pe_count = 13431 } } } # Generated by LVM2 version 2.03.11(2)-RHEL8 (2021-01-08): Wed Jan 27 14:42:31 2021 contents = "Text Format Volume Group" version = 1 description = "Write from vgcreate VG /dev/mapper/mpatha1." creation_host = "p8-224-node1.lab.msp.redhat.com" # Linux p8-224-node1.lab.msp.redhat.com 4.18.0-268.el8.ppc64le #1 SMP Mon Dec 28 04:29:22 EST 2020 ppc64le creation_time = 1611780151 # Wed Jan 27 14:42:31 2021 --- Found bad header or metadata values. [root@p8-224-node1 ~]# pvck --dump headers /dev/mapper/mpatha1 label_header at 512 label_header.id LABELONE label_header.sector 1 label_header.crc 0xb46a6824 label_header.offset 32 label_header.type LVM2 001 pv_header at 544 pv_header.pv_uuid Y4YlzlYEjzfsTsCQ39OQgaTJfCqymH2m pv_header.device_size 56371425280 pv_header.disk_locn[0] at 584 # location of data area pv_header.disk_locn[0].offset 33558016 pv_header.disk_locn[0].size 0 pv_header.disk_locn[1] at 600 # location list end pv_header.disk_locn[1].offset 0 pv_header.disk_locn[1].size 0 pv_header.disk_locn[2] at 616 # location of metadata area pv_header.disk_locn[2].offset 65536 pv_header.disk_locn[2].size 33492480 CHECK: pv_header.disk_locn[2].offset expected 4096 # for first mda pv_header.disk_locn[3] at 632 # location list end pv_header.disk_locn[3].offset 0 pv_header.disk_locn[3].size 0 pv_header_extension at 648 pv_header_extension.version 2 pv_header_extension.flags 1 pv_header_extension.disk_locn[0] at 656 # location list end pv_header_extension.disk_locn[0].offset 0 pv_header_extension.disk_locn[0].size 0 mda_header_2 at 65536 # metadata area mda_header_2.checksum 0x518e92ba mda_header_2.magic 0x204c564d3220785b35412572304e2a3e mda_header_2.version 1 mda_header_2.start 65536 mda_header_2.size 33492480 mda_header_2.raw_locn[0] at 65576 # commit mda_header_2.raw_locn[0].offset 512 mda_header_2.raw_locn[0].size 804 mda_header_2.raw_locn[0].checksum 0x78cb18c7 mda_header_2.raw_locn[0].flags 0x0 mda_header_2.raw_locn[1] at 65600 # precommit mda_header_2.raw_locn[1].offset 0 mda_header_2.raw_locn[1].size 0 mda_header_2.raw_locn[1].checksum 0x0 mda_header_2.raw_locn[1].flags 0x0 metadata text at 66048 crc 0x78cb18c7 # vgname VG seqno 1 Found bad header or metadata values. [root@p8-224-node1 ~]# echo $? 5 # Here is a 4k page x86_64 machine to compare [root@hayes-03 ~]# getconf PAGESIZE 4096 [root@hayes-03 ~]# pvcreate /dev/sd[bc]1 Physical volume "/dev/sdb1" successfully created. Physical volume "/dev/sdc1" successfully created. [root@hayes-03 ~]# pvck --dump metadata /dev/sdb1 [root@hayes-03 ~]# pvck --dump headers /dev/sdb1 label_header at 512 label_header.id LABELONE label_header.sector 1 label_header.crc 0xd19a1c58 label_header.offset 32 label_header.type LVM2 001 pv_header at 544 pv_header.pv_uuid RdkIkvL1pXPRxidWJhV1PVH26bbNjdfG pv_header.device_size 479559901184 pv_header.disk_locn[0] at 584 # location of data area pv_header.disk_locn[0].offset 1048576 pv_header.disk_locn[0].size 0 pv_header.disk_locn[1] at 600 # location list end pv_header.disk_locn[1].offset 0 pv_header.disk_locn[1].size 0 pv_header.disk_locn[2] at 616 # location of metadata area pv_header.disk_locn[2].offset 4096 pv_header.disk_locn[2].size 1044480 pv_header.disk_locn[3] at 632 # location list end pv_header.disk_locn[3].offset 0 pv_header.disk_locn[3].size 0 pv_header_extension at 648 pv_header_extension.version 2 pv_header_extension.flags 0 pv_header_extension.disk_locn[0] at 656 # location list end pv_header_extension.disk_locn[0].offset 0 pv_header_extension.disk_locn[0].size 0 mda_header_1 at 4096 # metadata area mda_header_1.checksum 0xdb8ed616 mda_header_1.magic 0x204c564d3220785b35412572304e2a3e mda_header_1.version 1 mda_header_1.start 4096 mda_header_1.size 1044480 mda_header_1.raw_locn[0] at 4136 # commit mda_header_1.raw_locn[0].offset 0 mda_header_1.raw_locn[0].size 0 mda_header_1.raw_locn[0].checksum 0x0 mda_header_1.raw_locn[0].flags 0x0 mda_header_1.raw_locn[1] at 4160 # precommit mda_header_1.raw_locn[1].offset 0 mda_header_1.raw_locn[1].size 0 mda_header_1.raw_locn[1].checksum 0x0 mda_header_1.raw_locn[1].flags 0x0 Marking verified now with the latest lvm build.
kernel-4.18.0-268.el8 BUILT: Mon Dec 28 03:47:31 CST 2020
lvm2-2.03.11-2.el8 BUILT: Thu Jan 28 14:41:14 CST 2021
lvm2-libs-2.03.11-2.el8 BUILT: Thu Jan 28 14:41:14 CST 2021
[root@p8-224-node1 ~]# uname -ar
Linux p8-224-node1.lab.msp.redhat.com 4.18.0-268.el8.ppc64le #1 SMP Mon Dec 28 04:29:22 EST 2020 ppc64le ppc64le ppc64le GNU/Linux
[root@p8-224-node1 ~]# vgcreate VG /dev/mapper/mpatha1
Volume group "VG" successfully created
[root@p8-224-node1 ~]# pvck --dump metadata /dev/mapper/mpatha1
metadata text at 66048 crc 0xb2fd4187 # vgname VG seqno 1
---
VG {
id = "6wGlD9-YQTU-Nj4y-IZ5n-7qb4-g4WL-4k1b9y"
seqno = 1
format = "lvm2"
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 8192
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "Y4Ylzl-YEjz-fsTs-CQ39-OQga-TJfC-qymH2m"
device = "/dev/mapper/mpatha1"
status = ["ALLOCATABLE"]
flags = []
dev_size = 110100440
pe_start = 65543
pe_count = 13431
}
}
}
# Generated by LVM2 version 2.03.11(2)-RHEL8 (2021-01-28): Mon Feb 1 18:22:29 2021
contents = "Text Format Volume Group"
version = 1
description = "Write from vgcreate VG /dev/mapper/mpatha1."
creation_host = "p8-224-node1.lab.msp.redhat.com" # Linux p8-224-node1.lab.msp.redhat.com 4.18.0-268.el8.ppc64le #1 SMP Mon Dec 28 04:29:22 EST 2020 ppc64le
creation_time = 1612225349 # Mon Feb 1 18:22:29 2021
---
[root@p8-224-node1 ~]# echo $?
0
[root@p8-224-node1 ~]# pvck --dump headers /dev/mapper/mpatha1
label_header at 512
label_header.id LABELONE
label_header.sector 1
label_header.crc 0xb46a6824
label_header.offset 32
label_header.type LVM2 001
pv_header at 544
pv_header.pv_uuid Y4YlzlYEjzfsTsCQ39OQgaTJfCqymH2m
pv_header.device_size 56371425280
pv_header.disk_locn[0] at 584 # location of data area
pv_header.disk_locn[0].offset 33558016
pv_header.disk_locn[0].size 0
pv_header.disk_locn[1] at 600 # location list end
pv_header.disk_locn[1].offset 0
pv_header.disk_locn[1].size 0
pv_header.disk_locn[2] at 616 # location of metadata area
pv_header.disk_locn[2].offset 65536
pv_header.disk_locn[2].size 33492480
pv_header.disk_locn[3] at 632 # location list end
pv_header.disk_locn[3].offset 0
pv_header.disk_locn[3].size 0
pv_header_extension at 648
pv_header_extension.version 2
pv_header_extension.flags 1
pv_header_extension.disk_locn[0] at 656 # location list end
pv_header_extension.disk_locn[0].offset 0
pv_header_extension.disk_locn[0].size 0
mda_header_2 at 65536 # metadata area
mda_header_2.checksum 0x1d6340d6
mda_header_2.magic 0x204c564d3220785b35412572304e2a3e
mda_header_2.version 1
mda_header_2.start 65536
mda_header_2.size 33492480
mda_header_2.raw_locn[0] at 65576 # commit
mda_header_2.raw_locn[0].offset 512
mda_header_2.raw_locn[0].size 804
mda_header_2.raw_locn[0].checksum 0xb2fd4187
mda_header_2.raw_locn[0].flags 0x0
mda_header_2.raw_locn[1] at 65600 # precommit
mda_header_2.raw_locn[1].offset 0
mda_header_2.raw_locn[1].size 0
mda_header_2.raw_locn[1].checksum 0x0
mda_header_2.raw_locn[1].flags 0x0
metadata text at 66048 crc 0xb2fd4187 # vgname VG seqno 1
[root@p8-224-node1 ~]# echo $?
0
Here is a repair example as well:
[root@p8-224-node1 ~]# pvck --dump metadata /dev/mapper/mpatha2 -f /tmp/foo
metadata text at 66048 crc 0xb46c6b40 # vgname test2 seqno 1
[root@p8-224-node1 ~]# cat /tmp/foo
test2 {
id = "qZ3MD5-ktbH-KKGq-3dJg-yWMM-CAom-TVFIGo"
seqno = 1
format = "lvm2"
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 8192
max_lv = 0
max_pv = 0
metadata_copies = 0
physical_volumes {
pv0 {
id = "lGxAYD-crgA-erOt-mw5J-E5mZ-43CS-0ED7JK"
device = "/dev/mapper/mpatha2"
status = ["ALLOCATABLE"]
flags = []
dev_size = 110100440
pe_start = 65535
pe_count = 13431
}
}
}
# Generated by LVM2 version 2.03.11(2)-RHEL8 (2021-01-28): Mon Feb 1 19:01:16 2021
contents = "Text Format Volume Group"
version = 1
description = "Write from vgcreate test2 /dev/mapper/mpatha2."
creation_host = "p8-224-node1.lab.msp.redhat.com" # Linux p8-224-node1.lab.msp.redhat.com 4.18.0-268.el8.ppc64le #1 SMP Mon Dec 28 04:29:22 EST 2020 ppc64le
creation_time = 1612227676 # Mon Feb 1 19:01:16 2021
[root@p8-224-node1 ~]# pvck --yes --repair -f /tmp/foo /dev/mapper/mpatha2
Writing label_header.crc 0xcef3da61 pv_header uuid lGxAYDcrgAerOtmw5JE5mZ43CS0ED7JK device_size 56371425280
Writing data_offset 33553920 mda1_offset 4096 mda1_size 33549824 mda2_offset 0 mda2_size 0
Writing metadata at 4608 length 810 crc 0xb46c6b40 mda1
Writing mda_header at 4096 mda1
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 (lvm2 bug fix and enhancement update), 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-2021:1659 |