Bug 131978 - pvcreate prints misleading error when given excluded device
Summary: pvcreate prints misleading error when given excluded device
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Alasdair Kergon
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-09-07 17:17 UTC by Alexandre Oliva
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-14 14:53:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Alexandre Oliva 2004-09-07 17:17:05 UTC
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 14:50:03 UTC
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.