Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
The device-mapper table is not being updated after an automatic segment merge made possible by a pvmove. It seems the on-disk metadata is updated, but not in the kernel.
Version-Release number of selected component (if applicable):
device-mapper-1.02.140-8.el7.x86_64
lvm2-2.02.171-8.el7.x86_64
kernel-3.10.0-693.2.2.el7.x86_64
Steps to Reproduce:
- Create volume group and span one logical volume across two PVs so that it has 2 segments:
[root@localhost ~]# vgcreate seg_vg /dev/sdb /dev/sdc
Physical volume "/dev/sdb" successfully created.
Physical volume "/dev/sdc" successfully created.
Volume group "seg_vg" successfully created
[root@localhost ~]# lvcreate -n lv1 -l 200 seg_vg /dev/sdb:0-99 /dev/sdc:0-99
Logical volume "lv1" created.
- Verify that we indeed have two segments, both in lvm and device-mapper:
[root@localhost ~]# lvs -o +devices,seg_pe_ranges
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices PE Ranges
root rhel -wi-ao---- <6.20g /dev/sda2(205) /dev/sda2:205-1790
swap rhel -wi-ao---- 820.00m /dev/sda2(0) /dev/sda2:0-204
lv1 seg_vg -wi-ao---- 800.00m /dev/sdb(0) /dev/sdb:0-99 <==== segment 1
lv1 seg_vg -wi-ao---- 800.00m /dev/sdc(0) /dev/sdc:0-99 <==== segment 2
[root@localhost ~]# dmsetup table seg_vg-lv1
0 819200 linear 8:16 2048 <=== segment 1
819200 819200 linear 8:32 2048 <=== segment 2
- Move the segment in sdc to a position directly after the sdb segment. This will trigger the automatic merge of these segments:
[root@localhost ~]# pvmove /dev/sdc:0-99 /dev/sdb:100-199
/dev/sdc: Moved: 2.00%
/dev/sdc: Moved: 100.00%
- Verify lvm shows one segment and unknown (X) attributes:
[root@localhost ~]# lvs -o +devices,seg_pe_ranges
WARNING: Cannot find matching striped segment for seg_vg/lv1.
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices PE Ranges
root rhel -wi-ao---- <6.20g /dev/sda2(205) /dev/sda2:205-1790
swap rhel -wi-ao---- 820.00m /dev/sda2(0) /dev/sda2:0-204
lv1 seg_vg -wi-XX--X- 800.00m /dev/sdb(0) /dev/sdb:0-199 <==== 1 segment
- Verify device-mapper shows 2 segments:
[root@localhost ~]# dmsetup table seg_vg-lv1
0 819200 linear 8:16 2048 <==== 1 segment
819200 819200 linear 8:16 821248 <==== 2 segments
- Remediate by refreshing the volume group:
[root@localhost ~]# vgchange --refresh seg_vg
- Verify lvm and device-mapper are consistent:
[root@localhost ~]# lvs -o +devices,seg_pe_ranges
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices PE Ranges
root rhel -wi-ao---- <6.20g /dev/sda2(205) /dev/sda2:205-1790
swap rhel -wi-ao---- 820.00m /dev/sda2(0) /dev/sda2:0-204
lv1 seg_vg -wi-ao---- 800.00m /dev/sdb(0) /dev/sdb:0-199
[root@localhost ~]# dmsetup table seg_vg-lv1
0 1638400 linear 8:16 2048
Actual results:
kernel state is not refreshed
Expected results:
kernel state should be consistent w/ lvm with no intervention after the merge