Bug 1498939

Summary: [RFE] implement better error reporting for failing pvcreate
Product: [Community] LVM and device-mapper Reporter: Zdenek Kabelac <zkabelac>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Command-line tools QA Contact: cluster-qe <cluster-qe>
Status: CLOSED NEXTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, thornber, zkabelac
Version: 2.02.175Flags: rule-engine: lvm-technical-solution?
rule-engine: lvm-test-coverage?
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-02 22:48:46 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 Zdenek Kabelac 2017-10-05 15:16:00 UTC
Description of problem:

When user runs 'pvcreate /dev/diskXYZ' he may observe this output:

# pvcreate /dev/diskXYZ
  Device /dev/diskXYZ not found (or ignored by filtering).

This might confuse users - since they are unaware what this means and it would be probably better to expose better message - i.e.  which filter (i.e. MD header found) cause this.  Otherwise  user needs to use  'pvcreate -vvv' and find out exact reason of failure - i.e.:

        /dev/diskXYZ: Skipping md component device

Other reason could be lvm.conf filtering setting, or lvmetad...

Existing error message could be giving more info.

Version-Release number of selected component (if applicable):
2.02.175

How reproducible:


Steps to Reproduce:
1. create mdadm and stop it
2. run pvcreate on one of md raid leg devices
3.

Actual results:


Expected results:


Additional info:

Comment 1 Alasdair Kergon 2017-10-17 02:34:43 UTC
Step one, separate 'not found' from 'excluded by filter'.

https://www.redhat.com/archives/lvm-devel/2017-October/msg00047.html

https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=146745ad88abc0512650b5b40d00ca587784ca36

Second stage will be to record which filter (perhaps in struct device, with some order of precedence so 'cached' doesn't appear if it doesn't need to).

Comment 2 David Teigland 2020-12-02 22:48:46 UTC
recently fixed