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 2040482 - lvmdevices --check|update do not seem to work currently
Summary: lvmdevices --check|update do not seem to work currently
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: lvm2
Version: 9.0
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On: 2039977
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-13 19:54 UTC by Corey Marthaler
Modified: 2022-05-17 16:25 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.03.15-0.1.20211115git4a1f617.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2039977
Environment:
Last Closed: 2022-05-17 15:56:34 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-107890 0 None None None 2022-01-13 19:57:41 UTC
Red Hat Product Errata RHBA-2022:3972 0 None None None 2022-05-17 15:56:39 UTC

Description Corey Marthaler 2022-01-13 19:54:23 UTC
+++ This bug was initially created as a clone of Bug #2039977 +++

Description of problem:
I wrote a scenario to corrupt each of the attributes of a devicesfile entry and it didn't appear that the check or update options do anything with the corruption. 


kernel-4.18.0-357.el8    BUILT: Wed Dec 22 15:55:27 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



LVMDEVICES(8)                                                                          System Manager's Manual                                                                          LVMDEVICES(8)
       Check the devices file and report incorrect values.

       lvmdevices --check
           [ COMMON_OPTIONS ]

       Update the devices file to fix incorrect values.

       lvmdevices --update
           [ COMMON_OPTIONS ]


SCENARIO - altered_devicesfile_check_and_repair:  Test the discovery and repair of an altered|corrupted devicesfile entry 

+++ Corrupting IDTYPE +++
Copying out blanked system.devices file to begin with
/tmp/system495.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --adddev /dev/sdd1
Altered entry:
IDTYPE=corrupted IDNAME=naa.6d094660575ece002291ba5c230d16c6 DEVNAME=/dev/sdd1 PVID=XstIe4l7LLT9ipevUzziOErCADLg29Uz PART=1 
Copying out altered system.devices file to hayes-01
/tmp/system576.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --check
  Devices file unknown naa.6d094660575ece002291ba5c230d16c6 PVID XstIe4l7LLT9ipevUzziOErCADLg29Uz last seen on /dev/sdd1 not found.
lvmdevices SHOULD have found the corruption for /dev/sdd1 entry
lvmdevices --update
  Devices file unknown naa.6d094660575ece002291ba5c230d16c6 PVID XstIe4l7LLT9ipevUzziOErCADLg29Uz last seen on /dev/sdd1 not found.
  No update for devices file is needed.
lvmdevices SHOULD have updated the corruption for /dev/sdd1 entry

+++ Corrupting IDNAME +++
Copying out blanked system.devices file to begin with
/tmp/system1539.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --adddev /dev/sdd1
Altered entry:
IDTYPE=sys_wwid IDNAME=corrupted DEVNAME=/dev/sdd1 PVID=XstIe4l7LLT9ipevUzziOErCADLg29Uz PART=1 
Copying out altered system.devices file to hayes-01
/tmp/system890.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --check
  Devices file sys_wwid corrupted PVID XstIe4l7LLT9ipevUzziOErCADLg29Uz last seen on /dev/sdd1 not found.
lvmdevices SHOULD have found the corruption for /dev/sdd1 entry
lvmdevices --update
  Devices file sys_wwid corrupted PVID XstIe4l7LLT9ipevUzziOErCADLg29Uz last seen on /dev/sdd1 not found.
  No update for devices file is needed.
lvmdevices SHOULD have updated the corruption for /dev/sdd1 entry

+++ Corrupting PVID +++
Copying out blanked system.devices file to begin with
/tmp/system1407.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --adddev /dev/sdd1
Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660575ece002291ba5c230d16c6 DEVNAME=/dev/sdd1 PVID=corrupted PART=1 
Copying out altered system.devices file to hayes-01
/tmp/system1364.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --check
  Device /dev/sdd1 has PVID XstIe4l7LLT9ipevUzziOErCADLg29Uz (devices file corrupted)
lvmdevices SHOULD have found the corruption for /dev/sdd1 entry
lvmdevices --update
  Device /dev/sdd1 has PVID XstIe4l7LLT9ipevUzziOErCADLg29Uz (devices file corrupted)
  Updated devices file to version 1.1.1256
lvmdevices SHOULD have updated the corruption for /dev/sdd1 entry

+++ Corrupting PART +++
Copying out blanked system.devices file to begin with
/tmp/system819.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --adddev /dev/sdd1
Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660575ece002291ba5c230d16c6 DEVNAME=/dev/sdd1 PVID=XstIe4l7LLT9ipevUzziOErCADLg29Uz PART=corrupted 
Copying out altered system.devices file to hayes-01
/tmp/system1450.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --check
  Devices file /dev/sdd is excluded by filter: device is partitioned.
lvmdevices SHOULD have found the corruption for /dev/sdd1 entry
lvmdevices --update
  No update for devices file is needed.
  Devices file /dev/sdd is excluded by filter: device is partitioned.
lvmdevices SHOULD have updated the corruption for /dev/sdd1 entry


Version-Release number of selected component (if applicable):
kernel-4.18.0-357.el8    BUILT: Wed Dec 22 15:55:27 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

--- Additional comment from David Teigland on 2022-01-12 23:07:03 UTC ---

The purpose of lvmdevices check|update is only vaguely described in the man page, so the main thing to do is to precisely define what is actually checked and fixed.  It's primarily the unstable DEVNAME field, but there might be one or two other things.

Comment 1 David Teigland 2022-01-14 21:56:39 UTC
in main branch: https://sourceware.org/git/?p=lvm2.git;a=commit;h=a972d63c547dc9699c0b3664175eb96b5d89ff8f

This improves the lvmdevices check output to have an error exit if the devices file needs an update.

Comment 2 David Teigland 2022-02-03 23:02:19 UTC
in main branch: https://sourceware.org/git/?p=lvm2.git;a=commit;h=8f50c5e79b6ce619a53d51353dded2f84953af00

improves adding/removing devices when the file has bad entries.

in main branch: https://sourceware.org/git/?p=lvm2.git;a=commit;h=3fce6a81f82f2b2b1f75e5d49dbffc77bd637b3c

fixes lvmdevices --deldev to work when the device is missing.

Comment 3 David Teigland 2022-02-07 15:29:27 UTC
(In reply to David Teigland from comment #2)
> in main branch:
> https://sourceware.org/git/?p=lvm2.git;a=commit;
> h=8f50c5e79b6ce619a53d51353dded2f84953af00
> 
> improves adding/removing devices when the file has bad entries.

That commit is actually associated with related lvmdevices bug 2040491.

Comment 4 David Teigland 2022-02-07 20:25:57 UTC
(In reply to David Teigland from comment #3)
> (In reply to David Teigland from comment #2)
> > in main branch:
> > https://sourceware.org/git/?p=lvm2.git;a=commit;
> > h=8f50c5e79b6ce619a53d51353dded2f84953af00
> > 
> > improves adding/removing devices when the file has bad entries.
> 
> That commit is actually associated with related lvmdevices bug 2040491.

wrong, that's a rhel8 bz.

the commit is actually associated with related lvmdevices bug 2040937 (rhel9 bz)

Comment 5 Corey Marthaler 2022-02-11 03:21:33 UTC
This appears fixed in the latest build. This can be marked Modified and the Fixed In Version updated.

kernel-5.14.0-55.el9    BUILT: Fri Feb  4 05:27:31 PM CST 2022
lvm2-2.03.15-0.1.20211115git4a1f617.el9    BUILT: Tue Feb  8 02:56:52 PM CST 2022
lvm2-libs-2.03.15-0.1.20211115git4a1f617.el9    BUILT: Tue Feb  8 02:56:52 PM CST 2022


SCENARIO - entry_deletion_w_missing_mpath_device:  Test stale devicesfile entry deletion using missing mpath devices (bug 2040482#c2)
WARNING: This scenario will end up repartitioning your device!
multipath /dev/sdc
adding entry to the devices file for /dev/mapper/mpatha1
creating PV on hayes-01 using device /dev/mapper/mpatha1
pvcreate --yes -ff  /dev/mapper/mpatha1
  Physical volume "/dev/mapper/mpatha1" successfully created.
Remove the backing mpath device and attempt to remove and re-add the device file entry for /dev/mapper/mpatha1
multipath -f mpatha
multipath -W
successfully reset wwids
Using gpt label
Disk size: 1907199 MB
Num partitions: 1
Adding new primary partition: (40, 3905945559) = 1907199 MB
Committing changes
lvmdevices --deldev /dev/mapper/mpatha1
  Devices file mpath_uuid part1-mpath-36d094660575ece002291b9e01bad8691 PVID mBCuq4JaUnN3hnwAi0ggQtCzWs6zb0lb last seen on /dev/mapper/mpatha1 not found.



SCENARIO - altered_pvid_check_and_repair:  Test the discovery and repair of an altered pvid in devicesfile entry (bug 2039977|2040482) 
Copying out blanked system.devices file to begin with
/tmp/system1227.devices -> hayes-01:/etc/lvm/devices/system.devices
adding entry to the devices file for /dev/sdc1
path:/dev/sdc1
Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660575ece002291b9e01bad8691 DEVNAME=/dev/sdc1 PVID=c0rrup7HQrZNds PART=1 
Copying out altered system.devices file to hayes-01
/tmp/system760.devices -> hayes-01:/etc/lvm/devices/system.devices
lvmdevices --check
  Device /dev/sdc1 has PVID mBCuq4JaUnN3hnwAi0ggQtCzWs6zb0lb (devices file c0rrup7HQrZNds)
  Updates needed for devices file.

lvmdevices --update
  Updated devices file to version 1.1.468

1.1.467 == 1.1.468
lvmdevices --deldev /dev/sdc1

Comment 6 Corey Marthaler 2022-02-17 18:25:58 UTC
Marking Verified:Tested with the current rpms.

kernel-5.14.0-58.el9    BUILT: Thu Feb 10 11:18:21 AM CST 2022
lvm2-2.03.14-4.el9    BUILT: Wed Feb 16 06:01:21 AM CST 2022
lvm2-libs-2.03.14-4.el9    BUILT: Wed Feb 16 06:01:21 AM CST 2022
lvm2-dbusd-2.03.14-4.el9    BUILT: Wed Feb 16 07:23:08 AM CST 2022


A few of these scenarios are still not fixed/supported with --check|--update yet, but the main issues associated with this bug are I believe. 

./devicesfile --devices /dev/sdc1 /dev/sde1 /dev/sdd1 /dev/sdf1 /dev/sdg1 /dev/sdh1 /dev/sdi1 -r /usr/tests/sts-rhel8.6 --node hayes-02 --testplan | grep 2040482    entry_deletion_w_missing_loopback_device --  Test stale devicesfile entry deletion using missing loopback devices (bug 2040482#c2)
    entry_deletion_w_missing_mpath_device --  Test stale devicesfile entry deletion using missing mpath devices (bug 2040482#c2)
    altered_partition_check_and_repair --  Test the discovery and repair of an altered partition value in devicesfile entry bugs 2039977|2040482 and --adddev segfault bugs 2040491|2040937 
    altered_pvid_check_and_repair --  Test the discovery and repair of an altered pvid in devicesfile entry (bug 2039977|2040482) 
    altered_pvid_w_pv_label_present_check_and_repair --  Test for the alteration of the devicesfiles pvid when a pv label exists (2039977|2040482) 
    altered_devname_check_and_repair --  Test the discovery and repair of an altered devname in devicesfile entry (bug 2039977|2040482) 
    altered_devname_w_pv_label_present_check_and_repair --  Test for the alteration of the devicesfiles devname when a pv label exists (2039977|2040482)



SCENARIO - altered_pvid_check_and_repair:  Test the discovery and repair of an altered pvid in devicesfile entry (bug 2039977|2040482) 
Copying out blanked system.devices file to begin with
/tmp/system1592.devices -> hayes-02:/etc/lvm/devices/system.devices
adding entry to the devices file for /dev/sdc1
path:/dev/sdc1
Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29ee1e0945a8 DEVNAME=/dev/sdc1 PVID=c0rrup7HQrZNds PART=1 
Copying out altered system.devices file to hayes-02
/tmp/system1827.devices -> hayes-02:/etc/lvm/devices/system.devices
lvmdevices --check
  Device /dev/sdc1 has no PVID (devices file c0rrup7HQrZNds)
  Updates needed for devices file.

lvmdevices --update
  Updated devices file to version 1.1.23

1.1.22 == 1.1.23
lvmdevices --deldev /dev/sdc1


SCENARIO - entry_deletion_w_missing_mpath_device:  Test stale devicesfile entry deletion using missing mpath devices (bug 2040482#c2)
WARNING: This scenario will end up repartitioning your device!
multipath /dev/sdc
adding entry to the devices file for /dev/mapper/mpatha1
creating PV on hayes-02 using device /dev/mapper/mpatha1
pvcreate --yes -ff  /dev/mapper/mpatha1
  Physical volume "/dev/mapper/mpatha1" successfully created.
Remove the backing mpath device and attempt to remove and re-add the device file entry for /dev/mapper/mpatha1
multipath -f mpatha
multipath -W
successfully reset wwids
Using gpt label
Disk size: 1907199 MB
Num partitions: 1
Adding new primary partition: (40, 3905945559) = 1907199 MB
Committing changes
lvmdevices --deldev /dev/mapper/mpatha1
  Devices file mpath_uuid part1-mpath-36d094660650d1e0022bd29ee1e0945a8 PVID OEfoz3N45zwOhexVtmX9VZWpES7Az9DN last seen on /dev/mapper/mpatha1 not found.


SCENARIO - altered_partition_check_and_repair:  Test the discovery and repair of an altered partition value in devicesfile entry bugs 2039977|2040482 and --adddev segfault bugs 2040491|2040937 
Copying out blanked system.devices file to begin with
/tmp/system1418.devices -> hayes-02:/etc/lvm/devices/system.devices
lvmdevices --adddev /dev/sdc1
Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29ee1e0945a8 DEVNAME=/dev/sdc1 PVID=OEfoz3N45zwOhexVtmX9VZWpES7Az9DN PART=9 
Copying out altered system.devices file to hayes-02
/tmp/system1219.devices -> hayes-02:/etc/lvm/devices/system.devices
lvmdevices --check
  Devices file sys_wwid naa.6d094660650d1e0022bd29ee1e0945a8 PVID OEfoz3N45zwOhexVtmX9VZWpES7Az9DN last seen on /dev/sdc1 not found.

lvmdevices should have properly added /dev/sdc1 entry
lvmdevices should have properly returned non zero for a check issue

lvmdevices --update
  No update for devices file is needed.

lvmdevices should have updated the partition change back
lvmdevices --adddev /dev/sdc1
  Devices file sys_wwid naa.6d094660650d1e0022bd29ee1e0945a8 PVID OEfoz3N45zwOhexVtmX9VZWpES7Az9DN last seen on /dev/sdc1 not found.
  WARNING: adding device /dev/sdc1 with PVID OEfoz3N45zwOhexVtmX9VZWpES7Az9DN which is already used for missing device.
  WARNING: adding device /dev/sdc1 with idname naa.6d094660650d1e0022bd29ee1e0945a8 which is already used for missing device.
Checking for segfault notification (bug 2040491|2040937)
1.1.28 == 1.1.29
Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29ee1e0945a8 DEVNAME=/dev/sdc1 PVID=OEfoz3N45zwOhexVtmX9VZWpES7Az9DN PART=1 
Copying out altered system.devices file to hayes-02
/tmp/system651.devices -> hayes-02:/etc/lvm/devices/system.devices
lvmdevices --deldev /dev/sdc1


SCENARIO - entry_deletion_w_missing_loopback_device:  Test stale devicesfile entry deletion using missing loopback devices (bug 2040482#c2)
50+0 records in
50+0 records out
52428800 bytes (52 MB, 50 MiB) copied, 0.0262522 s, 2.0 GB/s
adding entry to the devices file for /dev/loop0
creating PV on hayes-02 using device /dev/loop0
pvcreate --yes -ff  /dev/loop0
  Physical volume "/dev/loop0" successfully created.
Remove the backing loop device and attempt to remove and re-add the device file entry for /dev/loop0
lvmdevices --deldev /dev/loop0
  Devices file loop_file /tmp/loopback.658795.547 PVID nCDwLagTlIto1EA6YNImxLKYHM5KEJzy last seen on /dev/loop0 not found.


SCENARIO - altered_pvid_w_pv_label_present_check_and_repair:  Test for the alteration of the devicesfiles pvid when a pv label exists (2039977|2040482) 
Copying out blanked system.devices file to begin with
/tmp/system1594.devices -> hayes-02:/etc/lvm/devices/system.devices
adding entry to the devices file for /dev/sdc1
creating PV on hayes-02 using device /dev/sdc1
pvcreate --yes -ff  /dev/sdc1
  Physical volume "/dev/sdc1" successfully created.

Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29ee1e0945a8 DEVNAME=/dev/sdc1 PVID=c0rrup7HQrZNds PART=1 
Copying out altered system.devices file to hayes-02
/tmp/system478.devices -> hayes-02:/etc/lvm/devices/system.devices
path:/dev/sdc1
lvmdevices --check
  Device /dev/sdc1 has PVID KjxyNJq6R0017yzJunxtcITmG3ZCkWc0 (devices file c0rrup7HQrZNds)
  Updates needed for devices file.

lvmdevices --update
  Updated devices file to version 1.1.36

1.1.35 == 1.1.36
removing pv /dev/sdc1 on hayes-02
  Labels on physical volume "/dev/sdc1" successfully wiped.
removing entry from the devices file for /dev/sdc1


SCENARIO - altered_devname_w_pv_label_present_check_and_repair:  Test for the alteration of the devicesfiles devname when a pv label exists (2039977|2040482) 
Copying out blanked system.devices file to begin with
/tmp/system83.devices -> hayes-02:/etc/lvm/devices/system.devices
adding entry to the devices file for /dev/sdc1
creating PV on hayes-02 using device /dev/sdc1
pvcreate --yes -ff  /dev/sdc1
  Physical volume "/dev/sdc1" successfully created.

Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29ee1e0945a8 DEVNAME=/dev/sdc PVID=Vv64TugVo2b7fC62qv21cg7TsOKOGyG2 PART=1 
Copying out altered system.devices file to hayes-02
/tmp/system1498.devices -> hayes-02:/etc/lvm/devices/system.devices
path:/dev/sdc1
lvmdevices --check
  Device /dev/sdc1 has updated name (devices file /dev/sdc)
  Updates needed for devices file.

lvmdevices --update
  Updated devices file to version 1.1.41

1.1.40 == 1.1.41
removing pv /dev/sdc1 on hayes-02
  Labels on physical volume "/dev/sdc1" successfully wiped.
removing entry from the devices file for /dev/sdc1


SCENARIO - altered_devname_check_and_repair:  Test the discovery and repair of an altered devname in devicesfile entry (bug 2039977|2040482) 
Copying out blanked system.devices file to begin with
/tmp/system293.devices -> hayes-02:/etc/lvm/devices/system.devices
adding entry to the devices file for /dev/sdc1
path:/dev/sdc1
Altered entry:
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd29ee1e0945a8 DEVNAME=/dev/sdz1 PVID=. PART=1 
Copying out altered system.devices file to hayes-02
/tmp/system1231.devices -> hayes-02:/etc/lvm/devices/system.devices
lvmdevices --check
  Device /dev/sdc1 has updated name (devices file /dev/sdz1)
  Updates needed for devices file.

lvmdevices --update
  Updated devices file to version 1.1.45

1.1.44 == 1.1.45
lvmdevices --deldev /dev/sdc1

Comment 9 Corey Marthaler 2022-02-21 21:23:35 UTC
Marking VERIFIED based on comment #6 run on the latest build.

Comment 11 errata-xmlrpc 2022-05-17 15:56:34 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 (new packages: lvm2), 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:3972


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