Bug 1956949

Summary: new pvremove check uses new vague error message when pv label was already removed
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Command-line tools QA Contact: cluster-qe <cluster-qe>
Status: VERIFIED --- Docs Contact:
Severity: low    
Priority: low CC: agk, heinzm, jbrassow, msnitzer, prajnoha, teigland, thornber, zkabelac
Version: 8.5   
Target Milestone: beta   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.03.12-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Corey Marthaler 2021-05-04 18:04:00 UTC
Description of problem:

# 8.4
[root@hayes-01 ~]# pvremove /dev/sdd1
  Labels on physical volume "/dev/sdd1" successfully wiped.
[root@hayes-01 ~]# pvremove /dev/sdd1
  Failed to read lvm info for /dev/sdd1 PVID .
[root@hayes-01 ~]# echo $?
5


# 7.9 (and earlier 8.* i believe)
[root@mckinley-03 ~]# pvremove /dev/mapper/mpathc1
  Labels on physical volume "/dev/mapper/mpathc1" successfully wiped.
[root@mckinley-03 ~]# pvremove /dev/mapper/mpathc1
  No PV found on device /dev/mapper/mpathc1.
[root@mckinley-03 ~]# echo $?
5


Version-Release number of selected component (if applicable):
kernel-4.18.0-304.el8    BUILT: Tue Apr  6 04:39:38 CDT 2021
lvm2-2.03.11-5.el8    BUILT: Fri Mar  5 07:13:31 CST 2021
lvm2-libs-2.03.11-5.el8    BUILT: Fri Mar  5 07:13:31 CST 2021

Comment 3 Corey Marthaler 2021-06-01 16:35:00 UTC
Marking Verified:Tested in the latest lvm rpms.

kernel-4.18.0-305.7.el8.kpq1    BUILT: Mon May 17 12:55:07 CDT 2021
lvm2-2.03.12-2.el8    BUILT: Tue Jun  1 06:55:37 CDT 2021
lvm2-libs-2.03.12-2.el8    BUILT: Tue Jun  1 06:55:37 CDT 2021
device-mapper-1.02.177-2.el8    BUILT: Tue Jun  1 06:55:37 CDT 2021
device-mapper-libs-1.02.177-2.el8    BUILT: Tue Jun  1 06:55:37 CDT 2021


# devicefile off
[root@hayes-01 ~]# pvscan
  No matching physical volumes found
[root@hayes-01 ~]# pvcreate /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
[root@hayes-01 ~]# pvremove /dev/sdd1
  Labels on physical volume "/dev/sdd1" successfully wiped.
[root@hayes-01 ~]# pvremove /dev/sdd1
  No PV found on device /dev/sdd1.


# devicefile on
[root@hayes-01 ~]# pvcreate /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
  Creating devices file /etc/lvm/devices/system.devices
[root@hayes-01 ~]# pvremove /dev/sdd1
  Labels on physical volume "/dev/sdd1" successfully wiped.
[root@hayes-01 ~]# pvremove /dev/sdd1
  No PV found on device /dev/sdd1.