Bug 2052064
| Summary: | "Devices file /dev/sd* is excluded: device is partitioned" suggestion should be given for mpath devices as well | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | LVM and device-mapper development team <lvm-team> |
| lvm2 sub component: | Devices, Filtering and Stacking | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | low | ||
| Priority: | unspecified | CC: | agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, teigland, zkabelac |
| Version: | 8.6 | Keywords: | Reopened, Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.03.14-4.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-11-08 10:55:24 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
Corey Marthaler
2022-02-08 15:48:17 UTC
> At first, I thought these partitioned devices shouldn't even be allowed to > be added since they're unable to be used by LVM to make PVs. > [root@hayes-02 ~]# cat /etc/lvm/devices/system.devices > # LVM uses devices listed in this file. > # Created by LVM command pvremove pid 29036 at Tue Feb 8 09:22:41 2022 > VERSION=1.1.773 > > > # This sd device is partitioned > [root@hayes-02 ~]# lvmdevices --adddev /dev/sdc > WARNING: adding device /dev/sdc that is excluded by filter: device is > partitioned. > [root@hayes-02 ~]# echo $? > 0 > > # This mpath device is partitioned > [root@hayes-02 ~]# lvmdevices --adddev /dev/mapper/mpatha > WARNING: adding device /dev/mapper/mpatha that is excluded by filter: > device is partitioned. > [root@hayes-02 ~]# echo $? > 0 We don't restrict what's added to the devices file. A user can add anything they want, and can always do it manually without using a command. The lvm filtering (in the broadest sense) continues to run in label scan of a full lvm command. lvmdevices is not a "full" lvm command and is basically just a file editor for system.devices. It does run some limited filter checks for the sake of warning, but doesn't enforce. Also, there may be reasons why a user could need some devices file entries that are excluded by filters, e.g. for temporary conditions when changing things. That said, there could be some cases where we want to refuse adding certain entries to the file, I'm not sure of any off hand, perhaps if we knew the values were wrong. > Second, the use of "excluded by filter" in a warning is confusing in a post devicesfile lvm > era, as we no longer support filters I thought. Yeah, this is an unfortunate mistake we made in naming many years ago. In this context, "filter" refers to the general device filtering lvm does, specifically the partition filter (filter-partition.c), not the regex filter from the lvm.conf "filter" (filter-regex.c). The devices file is also implemented as a filter (filter-deviceid.c) The lvm.conf entry should have been named filter_regex. It would probably be an improvement to drop the words "by filter" in that message, although there are a lot of other messages like that which we'd want to consider at the same time for consistency. > Third, I originally read > "Remove partitioned device /dev/sdc from devices file." as LVM was removing > it for me but then later realized LVM is telling me to do so manually. All the partition checking/messages in lvmdevices was redone as part of bug 2040482, so we should look at this again when the next build is done. > So, at a minimum, the mpath pvcreate attempt should also have that warning. > [root@hayes-02 ~]# pvcreate /dev/mapper/mpatha > Devices file /dev/sdc is excluded by filter: device is partitioned. > Devices file /dev/mapper/mpatha is excluded by filter: device is > partitioned. > Cannot use /dev/mapper/mpatha: device is partitioned > # There should be a warning here as well then, correct? > [root@hayes-02 ~]# pvcreate /dev/mapper/mpatha1 > Devices file /dev/sdc is excluded by filter: device is partitioned. > Devices file /dev/mapper/mpatha is excluded by filter: device is > partitioned. > Physical volume "/dev/mapper/mpatha1" successfully created. Those two mpath pvcreates look correct, but I think you're suggesting that one of the other commands didn't look right. In summary, what I mainly see here are some fine tunings we may want to make to the warnings/messages related to the devices file. That's also a topic in bug 2050449, and I have some other places in mind for improving the warnings related to stale devices file entries. There are not specific bugs or messages to verify for this bz so I'm just going to close this. I've made some changes to messages related to the devices file, which I think will avoid some possible confusion. reopening this to use for this commit in main: https://sourceware.org/git/?p=lvm2.git;a=commit;h=8db3b11e4ed94974bc25c26e2f1271c34f6ccf15 8db3b11e4ed9 change messages about filtered devices I installed the latest 8.7 build and wanted to go over the new behavior. This appears correct and consistent now for both scenarios. 1. There is no mention of filters when adding or pv creating either the partitioned mpath or sd device. 2. The pvcreate does not have a "Remove partitioned device <device> from devices" warning anymore for the sd device. kernel-4.18.0-400.el8 BUILT: Fri Jun 10 13:11:32 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 # This sd device is partitioned [root@hayes-01 ~]# cat /etc/lvm/devices/system.devices # LVM uses devices listed in this file. # Created by LVM command lvmdevices pid 6949 at Thu Jun 16 20:42:19 2022 VERSION=1.1.328 IDTYPE=sys_wwid IDNAME=naa.6d094660575ece002291bb4a313e4759 DEVNAME=/dev/sdf PVID=. IDTYPE=sys_wwid IDNAME=naa.6d094660575ece002291bb4a313e4759 DEVNAME=/dev/sdf1 PVID=. PART=1 [root@hayes-01 ~]# [root@hayes-01 ~]# pvcreate /dev/sdf1 Devices file /dev/sdf is excluded: device is partitioned. WARNING: adding device /dev/sdf1 with idname naa.6d094660575ece002291bb4a313e4759 which is already used for /dev/sdf. Physical volume "/dev/sdf1" successfully created. # This mpath device is partitioned [root@hayes-01 ~]# cat /etc/lvm/devices/system.devices # LVM uses devices listed in this file. # Created by LVM command lvmdevices pid 7168 at Thu Jun 16 20:46:22 2022 VERSION=1.1.334 IDTYPE=mpath_uuid IDNAME=part1-mpath-36d094660575ece002291bb4a313e4759 DEVNAME=/dev/mapper/mpathb1 PVID=. IDTYPE=devname IDNAME=/dev/mapper/mpathb1p1 DEVNAME=/dev/mapper/mpathb1p1 PVID=. [root@hayes-01 ~]# pvcreate /dev/mapper/mpathb1p1 Devices file /dev/mapper/mpathb1 is excluded: device is partitioned. Physical volume "/dev/mapper/mpathb1p1" successfully created. > IDTYPE=mpath_uuid IDNAME=part1-mpath-36d094660575ece002291bb4a313e4759 DEVNAME=/dev/mapper/mpathb1 PVID=. > IDTYPE=devname IDNAME=/dev/mapper/mpathb1p1 DEVNAME=/dev/mapper/mpathb1p1 PVID=. > [root@hayes-01 ~]# pvcreate /dev/mapper/mpathb1p1 > Devices file /dev/mapper/mpathb1 is excluded: device is partitioned. > Physical volume "/dev/mapper/mpathb1p1" successfully created. It's pretty clear that mpathb1 represents a partition on the underlying dev (based on the dm uuid part1-mpath-...), and then apparently a partition table has been written to mpathb1 and kpartx then added mpathb1p1. I asked Ben, and this kind of partition-on-partition is not something familiar to him either. So, I'm wondering if this kind of device setup has been used for anything before, or if it's useful in some way? Updating the summary to reflect what was actually changed and what was checked here. This message is now printed for both partitioned sd devices and partitioned mpath devices: "Devices file /dev/* is excluded: device is partitioned" To be clear, the "Remove partitioned device /dev/* from devices file." message no longer exists for either sd or mpath now. Marking Verified:Tested with the latest rpms. 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 Verified with latest kernel/lvm2 as well. kernel-4.18.0-411.el8 BUILT: Wed Jul 20 18:42:42 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 - partitioned_mpath_device_PV: Check for 'excluded: device is partitioned' message when creating a PV from a partitioned mpath device already existing in the devicesfile (bug 2052064) Copying out blanked system.devices file to begin with /tmp/system113.devices -> hayes-01:/etc/lvm/devices/system.devices WARNING: This scenario will end up repartitioning your device for use w/ mpath! multipath /dev/sde create: mpatha (36d094660575ece002291bade2acdbd28) undef DELL,PERC H330 Adp size=1.8T features='0' hwhandler='0' wp=undef `-+- policy='service-time 0' prio=1 status=undef `- 0:2:4:0 sde 8:64 undef ready running adding entry to the devices file for /dev/mapper/mpatha1 Using gpt label Disk size: 1907199 MB Num partitions: 1 Adding new primary partition: (40, 3905945479) = 1907199 MB Committing changes adding entry to the devices file for /dev/mapper/mpatha1p1 Devices file /dev/mapper/mpatha1 is excluded: device is partitioned. Labels on physical volume "/dev/mapper/mpatha1p1" successfully wiped. removing entry from the devices file for /dev/mapper/mpatha1p1 removing entry from the devices file 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 adding entry to the devices file for /dev/sde1 creating PV on hayes-01 using device /dev/sde1 pvcreate --yes -ff --zero y /dev/sde1 Wiping gpt signature on /dev/sde1. Wiping gpt signature on /dev/sde1. Wiping PMBR signature on /dev/sde1. Physical volume "/dev/sde1" successfully created. removing pv /dev/sde1 on hayes-01 Labels on physical volume "/dev/sde1" successfully wiped. removing entry from the devices file for /dev/sde1 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 |