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 2090949 - When using the argument --devicesfile a misspelled filename results in no filter being used.
Summary: When using the argument --devicesfile a misspelled filename results in no fil...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-27 03:54 UTC by Lance Digby
Modified: 2022-11-08 12:52 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.03.14-5.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-08 10:55:29 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-123522 0 None None None 2022-05-27 04:06:21 UTC
Red Hat Product Errata RHBA-2022:7792 0 None None None 2022-11-08 10:55:45 UTC

Comment 1 David Teigland 2022-05-27 14:15:41 UTC
I completely agree, working on a patch.

Comment 2 David Teigland 2022-05-27 19:51:20 UTC
fixed in main branch
https://sourceware.org/git/?p=lvm2.git;a=commit;h=bfe072e4388b530cbf5369be8a8f1305220198bf

devices file: fail if --devicesfile filename doesn't exist

A typo of the filename after --devicesfile should result in a
command error rather than the command falling back to using no
devices file at all.  Exception is vgcreate|pvcreate which
create a new devices file if the file name doesn't exist.

Comment 8 Corey Marthaler 2022-07-05 20:21:48 UTC
According to comment #2, we should be failing when the non default file is missing.

kernel-4.18.0-398.g366e.el8.kpq1    BUILT: Tue Jun  7 04:56:38 CDT 2022
lvm2-2.03.14-4.el8    BUILT: Wed Jun 15 17:14:34 CDT 2022
lvm2-libs-2.03.14-4.el8    BUILT: Wed Jun 15 17:14:34 CDT 2022
device-mapper-1.02.181-4.el8    BUILT: Wed Jun 15 17:14:34 CDT 2022


[root@hayes-01 ~]# lvcreate --yes --type linear -n dflinear --devicesfile pers.devices -L 500M df  
  Devices file not found: /etc/lvm/devices/pers.devices
  Failed to set up devices.
  Volume group "df" not found
  Cannot process volume group df
[root@hayes-01 ~]# echo $?
5

[root@hayes-01 ~]# lvs -a -o +devices --devicesfile pers.devices
  Devices file not found: /etc/lvm/devices/pers.devices
  Failed to set up devices.
[root@hayes-01 ~]# echo $?
0

[root@hayes-01 ~]# lvscan --devicesfile pers.devices
  Devices file not found: /etc/lvm/devices/pers.devices
  Failed to set up devices.
[root@hayes-01 ~]# echo $?
0

[root@hayes-01 ~]# lvdisplay --devicesfile pers.devices
  Devices file not found: /etc/lvm/devices/pers.devices
  Failed to set up devices.
[root@hayes-01 ~]# echo $?
0

Comment 12 David Teigland 2022-07-06 15:26:44 UTC
(In reply to Corey Marthaler from comment #8)
> According to comment #2, we should be failing when the non default file is
> missing.

Pushed a fix to use an error exit code when the --devicesfile name doesn't exist.

main branch:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=92b4fcf57f3c6d212d06b72b097e1a06e6efb84b

rhel-8.7.0 branch:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=73b9a2805ca2f2c70f6f631b405f8fea3f72f23b

Comment 13 Corey Marthaler 2022-07-19 21:35:42 UTC
Marking Verified:Tested (and moving to MODIFIED since there's a fixed in version list).

kernel-4.18.0-409.el8    BUILT: Tue Jul 12 00:16:54 CDT 2022
lvm2-2.03.14-5.el8    BUILT: Thu Jul 14 09:23:13 CDT 2022
lvm2-libs-2.03.14-5.el8    BUILT: Thu Jul 14 09:23:13 CDT 2022


SCENARIO - use_of_devicesfile_as_an_argument_for_non_create_power_cmds:  Check the usage of --devicesfile as an argument for a variety of LVM commands that do NOT have the power to create the devices file (bug 2090949) 
adding entry to the devices file for /dev/sde1
creating PV on hayes-01 using device /dev/sde1
pvcreate --yes -ff   /dev/sde1
  Physical volume "/dev/sde1" successfully created.
adding entry to the devices file for /dev/sdd1
creating PV on hayes-01 using device /dev/sdd1
pvcreate --yes -ff   /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
adding entry to the devices file for /dev/sdh1
creating PV on hayes-01 using device /dev/sdh1
pvcreate --yes -ff   /dev/sdh1
  Physical volume "/dev/sdh1" successfully created.
adding entry to the devices file for /dev/sdi1
creating PV on hayes-01 using device /dev/sdi1
pvcreate --yes -ff   /dev/sdi1
  Physical volume "/dev/sdi1" successfully created.
creating VG on hayes-01 using PV(s) /dev/sde1 /dev/sdd1 /dev/sdh1 /dev/sdi1
vgcreate    df /dev/sde1 /dev/sdd1 /dev/sdh1 /dev/sdi1
  Volume group "df" successfully created
lvcreate --yes --type linear -n dflinear --devicesfile pers.devices -L 500M df  
Devices file not found: /etc/lvm/devices/pers.devices
  Failed to set up devices.
lvcreate --yes --type linear -n dflinear  -L 500M df  
Logical volume "dflinear" created.

lvs -a -o +devices --devicesfile pers.devices
Devices file not found: /etc/lvm/devices/pers.devices
  Failed to set up devices.

lvscan --devicesfile pers.devices
Devices file not found: /etc/lvm/devices/pers.devices
  Failed to set up devices.

lvdisplay --devicesfile pers.devices
Devices file not found: /etc/lvm/devices/pers.devices
  Failed to set up devices.

lvremove  -f df/dflinear
  Logical volume "dflinear" successfully removed.
removing vg df from hayes-01
  Volume group "df" successfully removed
removing pv /dev/sde1 on hayes-01
  Labels on physical volume "/dev/sde1" successfully wiped.
removing entry from the devices file for /dev/sde1
removing pv /dev/sdd1 on hayes-01
  Labels on physical volume "/dev/sdd1" successfully wiped.
removing entry from the devices file for /dev/sdd1
removing pv /dev/sdh1 on hayes-01
  Labels on physical volume "/dev/sdh1" successfully wiped.
removing entry from the devices file for /dev/sdh1
removing pv /dev/sdi1 on hayes-01
  Labels on physical volume "/dev/sdi1" successfully wiped.
removing entry from the devices file for /dev/sdi1


SCENARIO - use_of_devicesfile_as_an_argument_for_create_power_cmds:  Check the usage of --devicesfile as an argument for a variety of LVM commands that HAVE the power to create the devices file (bug 2101025) 
adding entry to the devices file for /dev/sde1
creating PV on hayes-01 using device /dev/sde1
pvcreate --yes -ff  --devicesfile pers.devices /dev/sde1
  Physical volume "/dev/sde1" successfully created.
PV creation should NOT have passed
adding entry to the devices file for /dev/sde1
creating PV on hayes-01 using device /dev/sde1
pvcreate --yes -ff   /dev/sde1
  Physical volume "/dev/sde1" successfully created.
adding entry to the devices file for /dev/sdd1
creating PV on hayes-01 using device /dev/sdd1
pvcreate --yes -ff   /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
adding entry to the devices file for /dev/sdh1
creating PV on hayes-01 using device /dev/sdh1
pvcreate --yes -ff   /dev/sdh1
  Physical volume "/dev/sdh1" successfully created.
adding entry to the devices file for /dev/sdi1
creating PV on hayes-01 using device /dev/sdi1
pvcreate --yes -ff   /dev/sdi1
  Physical volume "/dev/sdi1" successfully created.
creating VG on hayes-01 using PV(s) /dev/sde1 /dev/sdd1 /dev/sdh1 /dev/sdi1
vgcreate   --devicesfile pers.devices df /dev/sde1 /dev/sdd1 /dev/sdh1 /dev/sdi1
  Device /dev/sde1 has PVID sNNJ18iUkIbMtp3SNrEnLDgwk0vOoeJZ (devices file cxxa76bGeCLmmDfcMa49kU1fCD8jzUNc)
  Volume group "df" successfully created
VG creation should NOT have passed
  Volume group "df" successfully removed
removing pv /dev/sde1 on hayes-01
  Labels on physical volume "/dev/sde1" successfully wiped.
removing entry from the devices file for /dev/sde1
removing pv /dev/sdd1 on hayes-01
  Labels on physical volume "/dev/sdd1" successfully wiped.
removing entry from the devices file for /dev/sdd1
removing pv /dev/sdh1 on hayes-01
  Labels on physical volume "/dev/sdh1" successfully wiped.
removing entry from the devices file for /dev/sdh1
removing pv /dev/sdi1 on hayes-01
  Labels on physical volume "/dev/sdi1" successfully wiped.
removing entry from the devices file for /dev/sdi1

Comment 18 errata-xmlrpc 2022-11-08 10:55:29 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:7792


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