Bug 131978 - pvcreate prints misleading error when given excluded device
pvcreate prints misleading error when given excluded device
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-09-07 13:17 EDT by Alexandre Oliva
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-14 10:53:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alexandre Oliva 2004-09-07 13:17:05 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2)
Gecko/20040809

Description of problem:
What's wrong with this picture?

# sfdisk -l /dev/sdb
[...]
/dev/sdb8      19929+  24791    4863-  39062016   8e  Linux LVM
# ls -l /dev/sdb8
brw-rw----  1 root disk 8, 24 Sep  7 01:18 /dev/sdb8
# pvcreate /dev/sdb8
  /dev/sdb8: Couldn't find device.

First I blamed udev, but as it turned out the device was there.  Then
I blamed hotplugging (this is a Firewire-connected disk), but
rebooting didn't fix it.

Some stracing revealed it actually succeeded in stat()ing the device,
and I could actually create other filesystems there, just not physical
volumes.

After much head scratching, it dawned on me:

# cat /etc/lvm/lvm.conf
devices {
    filter = [ "a|/dev/md.*|", "r|.*|" ]
}

(this is from back when vgscan didn't check for raid signatures, and
made a mess of raid 1 devices)

So, I add something that would match /dev/sdb8, and voila, pvcreate
works.  And then I take it back out, and pvcreate *still* works.

So there are two problems:

1) the error message above is *very* confusing, there's much room for
improvement (I realize the string freeze may be an issue)

2) if it rejects a device, it should do so consistently, regardless of
the former presence of a physical volume signature.

Version-Release number of selected component (if applicable):
lvm2-2.00.21-2

How reproducible:
Always

Steps to Reproduce:
1.Tweak the filter regexp in /etc/lvm/lvm.conf such that a certain
partition doesn't match
2.pvcreate it
3.Revert the change
4.pvcreate again
5.Re-instate the change
6.pvcreate again


Actual Results:  2 fails; 4 and 6 work

Expected Results:  2 should fail with a better error, and so should 6.
 4 is ok.

Additional info:
Comment 1 Alasdair Kergon 2004-09-14 10:50:03 EDT
1) Added hint to check filters to that error message.
2) Changes to the filters don't take effect until you run vgscan (as
per comment in the config file).  [If you don't like this, you can
remove the cache and set write_cache_state to 0.]

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