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 2027906 - 'pvcreate --test' should not be modifying the devices/system.devices file
Summary: 'pvcreate --test' should not be modifying the devices/system.devices file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.6
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 2027913
TreeView+ depends on / blocked
 
Reported: 2021-12-01 02:52 UTC by Corey Marthaler
Modified: 2022-05-10 16:38 UTC (History)
8 users (show)

Fixed In Version: lvm2-2.03.14-3.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2027913 (view as bug list)
Environment:
Last Closed: 2022-05-10 15:22:14 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-104393 0 None None None 2021-12-01 04:50:36 UTC
Red Hat Product Errata RHBA-2022:2038 0 None None None 2022-05-10 15:22:30 UTC

Description Corey Marthaler 2021-12-01 02:52:53 UTC
Description of problem:
# Normal device PV (/dev/sdb1)

[root@hayes-02 ~]# cat /etc/lvm/devices/system.devices
# LVM uses devices listed in this file.
# Created by LVM command pvremove pid 1644466 at Tue Nov 30 20:45:23 2021
VERSION=1.1.4736

[root@hayes-02 ~]# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created.

[root@hayes-02 ~]# cat /etc/lvm/devices/system.devices
# LVM uses devices listed in this file.
# Created by LVM command pvcreate pid 1644509 at Tue Nov 30 20:45:49 2021
VERSION=1.1.4737
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29e81db0cefc DEVNAME=/dev/sdb1 PVID=4Wj0WrIIBKh8h3zQMn8cQHuxx2HFBFkT PART=1

[root@hayes-02 ~]# pvcreate --test /dev/sdb1
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Physical volume "/dev/sdb1" successfully created.
[root@hayes-02 ~]# cat /etc/lvm/devices/system.devices
# LVM uses devices listed in this file.
# Created by LVM command fullreport pid 1644515 at Tue Nov 30 20:45:59 2021
VERSION=1.1.4739
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29e81db0cefc DEVNAME=/dev/sdb1 PVID=4Wj0WrIIBKh8h3zQMn8cQHuxx2HFBFkT PART=1



# LV device PV (/dev/VG/LV)

[root@hayes-02 ~]# vgcreate VG /dev/sdb1
  Volume group "VG" successfully created
[root@hayes-02 ~]# lvcreate -n LV -L 10G VG
  Logical volume "LV" created.
[root@hayes-02 ~]# pvcreate --config devices/scan_lvs=1 /dev/VG/LV 
  Physical volume "/dev/VG/LV" successfully created.

[root@hayes-02 ~]# cat /etc/lvm/devices/system.devices
# LVM uses devices listed in this file.
# Created by LVM command pvcreate pid 1644564 at Tue Nov 30 20:48:49 2021
VERSION=1.1.4743
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29e81db0cefc DEVNAME=/dev/sdb1 PVID=4Wj0WrIIBKh8h3zQMn8cQHuxx2HFBFkT PART=1
IDTYPE=lvmlv_uuid IDNAME=LVM-dDU10KcCqvdXk1ojfPActULMZU3m3ED2QbQO41RHwBSfh66Y0BB5O0TiPZR43D1C DEVNAME=/dev/VG/LV PVID=Q4DRDDYcMe0d2Ico5wqC9nF99RFJFp7C

[root@hayes-02 ~]# pvcreate --test --config devices/scan_lvs=1 /dev/VG/LV 
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Physical volume "/dev/VG/LV" successfully created.

# PVID was altered
[root@hayes-02 ~]# cat /etc/lvm/devices/system.devices
# LVM uses devices listed in this file.
# Created by LVM command pvcreate pid 1644569 at Tue Nov 30 20:49:10 2021
VERSION=1.1.4744
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29e81db0cefc DEVNAME=/dev/sdb1 PVID=4Wj0WrIIBKh8h3zQMn8cQHuxx2HFBFkT PART=1
IDTYPE=lvmlv_uuid IDNAME=LVM-dDU10KcCqvdXk1ojfPActULMZU3m3ED2QbQO41RHwBSfh66Y0BB5O0TiPZR43D1C DEVNAME=/dev/VG/LV PVID=cOWcuNNc9Ti5HUjCwSb14HUXhHHP4zm2


Version-Release number of selected component (if applicable):
kernel-4.18.0-348.4.el8.kpq0    BUILT: Wed Oct 27 15:00:32 CDT 2021
lvm2-2.03.14-1.el8    BUILT: Wed Oct 20 10:18:17 CDT 2021
lvm2-libs-2.03.14-1.el8    BUILT: Wed Oct 20 10:18:17 CDT 2021


How reproducible:
Everytime

Comment 1 David Teigland 2021-12-01 16:18:40 UTC
fixed here
https://sourceware.org/git/?p=lvm2.git;a=commit;h=d5402e55f6b9d3a5f407502ce5c7a8a5bfd12243

$ lvmdevices
  Device /dev/mapper/mpatha IDTYPE=mpath_uuid IDNAME=mpath-3690b11c0000438ad0000057150910423 DEVNAME=/dev/mapper/mpatha PVID=57s3g8IhD7pVpnPmffF2V1u1jL7spkdb
  Device /dev/sda2 IDTYPE=sys_wwid IDNAME=naa.50014ee058bfe7b3 DEVNAME=/dev/sda2 PVID=qaWEiaFIIGJwyAgTWucDK00wVFg0s3dj PART=2
$ pvcreate --test /dev/sdb1
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Physical volume "/dev/sdb1" successfully created.
$ lvmdevices
  Device /dev/mapper/mpatha IDTYPE=mpath_uuid IDNAME=mpath-3690b11c0000438ad0000057150910423 DEVNAME=/dev/mapper/mpatha PVID=57s3g8IhD7pVpnPmffF2V1u1jL7spkdb
  Device /dev/sda2 IDTYPE=sys_wwid IDNAME=naa.50014ee058bfe7b3 DEVNAME=/dev/sda2 PVID=qaWEiaFIIGJwyAgTWucDK00wVFg0s3dj PART=2
$ pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created.
$lvmdevices
  Device /dev/mapper/mpatha IDTYPE=mpath_uuid IDNAME=mpath-3690b11c0000438ad0000057150910423 DEVNAME=/dev/mapper/mpatha PVID=57s3g8IhD7pVpnPmffF2V1u1jL7spkdb
  Device /dev/sda2 IDTYPE=sys_wwid IDNAME=naa.50014ee058bfe7b3 DEVNAME=/dev/sda2 PVID=qaWEiaFIIGJwyAgTWucDK00wVFg0s3dj PART=2
  Device /dev/sdb1 IDTYPE=sys_wwid IDNAME=naa.690b11c0000438ad0000056550910404 DEVNAME=/dev/sdb1 PVID=sMMfEo7rc7MFETOvDRDOF5FswEKWZbyQ PART=1

Comment 4 Corey Marthaler 2022-01-05 19:05:29 UTC
This fixed it verified in the latest build.

kernel-4.18.0-355.el8.kpq0    BUILT: Wed Dec 15 13:27:55 CST 2021
lvm2-2.03.14-3.el8    BUILT: Tue Jan  4 14:54:16 CST 2022
lvm2-libs-2.03.14-3.el8    BUILT: Tue Jan  4 14:54:16 CST 2022


Without fix:

SCENARIO - pvcreate_test_on_linear_alteration_check:  Test for the alteration of the devicesfiles when pvcreate --test is used on linear device (bug 2027906 2027913) 
adding entry to the devices file for /dev/sdd1
creating PV on hayes-03 using device /dev/sdd1
pvcreate --yes -ff  /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
creating VG on hayes-03 using PV(s) /dev/sdd1
vgcreate   df /dev/sdd1
  Volume group "df" successfully created
lvcreate --yes --type linear -n dflv -L 500M df  
  Logical volume "dflv" created.
adding entry to the devices file for /dev/df/dflv
creating PV on hayes-03 using device /dev/df/dflv
pvcreate --yes -ff --config devices/scan_lvs=1 /dev/df/dflv
  Physical volume "/dev/df/dflv" successfully created.
pvcreate --test --config devices/scan_lvs=1 /dev/df/dflv
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Physical volume "/dev/df/dflv" successfully created.
LVM pre:4mzoQPbCgIbg2f3jdP1eWA4H5LjENzIp post:4mzoQPbCgIbg2f3jdP1eWA4H5LjENzIp
FILE pre:4mzoQPbCgIbg2f3jdP1eWA4H5LjENzIp post:9g3sa8K2xK7FDx3jG3ShcEqSIDLqC804
File PVIDs were altered by the command: pvcreate --test --config devices/scan_lvs=1 /dev/df/dflv (possible regression of bugs 2027906 2027913)



With fix:
SCENARIO - pvcreate_test_on_linear_alteration_check:  Test for the alteration of the devicesfiles when pvcreate --test is used on linear device (bug 2027906 2027913) 
adding entry to the devices file for /dev/sdd1
creating PV on hayes-02 using device /dev/sdd1
pvcreate --yes -ff  /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
creating VG on hayes-02 using PV(s) /dev/sdd1
vgcreate   df /dev/sdd1
  Volume group "df" successfully created
lvcreate --yes --type linear -n dflv -L 500M df  
  Logical volume "dflv" created.
adding entry to the devices file for /dev/df/dflv
creating PV on hayes-02 using device /dev/df/dflv
pvcreate --yes -ff --config devices/scan_lvs=1 /dev/df/dflv
  Physical volume "/dev/df/dflv" successfully created.
pvcreate --test --config devices/scan_lvs=1 /dev/df/dflv
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Physical volume "/dev/df/dflv" successfully created.
LVM pre:dykzDyH4YhaC67zJCeolHFrA7yLdfMSi post:dykzDyH4YhaC67zJCeolHFrA7yLdfMSi
FILE pre:dykzDyH4YhaC67zJCeolHFrA7yLdfMSi post:dykzDyH4YhaC67zJCeolHFrA7yLdfMSi
removing pv /dev/df/dflv on hayes-02
  Labels on physical volume "/dev/df/dflv" successfully wiped.
removing entry from the devices file for /dev/df/dflv
lvremove  -f df/dflv
  Logical volume "dflv" successfully removed.
removing vg df from hayes-02
  Volume group "df" successfully removed
removing pv /dev/sdd1 on hayes-02
  Labels on physical volume "/dev/sdd1" successfully wiped.
removing entry from the devices file for /dev/sdd1

Comment 9 Corey Marthaler 2022-01-28 23:40:44 UTC
These scenarios pass in the latest userspace/kernel as well, marking VERIFIED.

kernel-4.18.0-360.el8    BUILT: Sun Jan 16 20:27:55 CST 2022
lvm2-2.03.14-3.el8    BUILT: Tue Jan  4 14:54:16 CST 2022
lvm2-libs-2.03.14-3.el8    BUILT: Tue Jan  4 14:54:16 CST 2022

SCENARIO - pvcreate_test_on_linear_alteration_check:  Test for the alteration of the devicesfiles when pvcreate --test is used on linear device (bug 2027906 2027913) 
adding entry to the devices file for /dev/sdd1
creating PV on hayes-02 using device /dev/sdd1
pvcreate --yes -ff  /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
creating VG on hayes-02 using PV(s) /dev/sdd1
vgcreate   df /dev/sdd1
  Volume group "df" successfully created
lvcreate --yes --type linear -n dflv -L 500M df  
  Wiping LVM2_member signature on /dev/df/dflv.
  Logical volume "dflv" created.
adding entry to the devices file for /dev/df/dflv
creating PV on hayes-02 using device /dev/df/dflv
pvcreate --yes -ff --config devices/scan_lvs=1 /dev/df/dflv
  Physical volume "/dev/df/dflv" successfully created.
pvcreate --test --config devices/scan_lvs=1 /dev/df/dflv
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Physical volume "/dev/df/dflv" successfully created.
LVM pre:O07UeCX0HvZNH9QvEU81hH9BuGrEy63Y post:O07UeCX0HvZNH9QvEU81hH9BuGrEy63Y
FILE pre:O07UeCX0HvZNH9QvEU81hH9BuGrEy63Y post:O07UeCX0HvZNH9QvEU81hH9BuGrEy63Y
removing pv /dev/df/dflv on hayes-02
  Labels on physical volume "/dev/df/dflv" successfully wiped.
removing entry from the devices file for /dev/df/dflv
lvremove  -f df/dflv
  Logical volume "dflv" successfully removed.
removing vg df from hayes-02
  Volume group "df" successfully removed
removing pv /dev/sdd1 on hayes-02
  Labels on physical volume "/dev/sdd1" successfully wiped.
removing entry from the devices file for /dev/sdd1

Comment 11 errata-xmlrpc 2022-05-10 15:22:14 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 (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-2022:2038


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