Red Hat Bugzilla – Bug 131978
pvcreate prints misleading error when given excluded device
Last modified: 2007-11-30 17:10:48 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2)
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
After much head scratching, it dawned on me:
# cat /etc/lvm/lvm.conf
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):
Steps to Reproduce:
1.Tweak the filter regexp in /etc/lvm/lvm.conf such that a certain
partition doesn't match
3.Revert the change
5.Re-instate the change
Actual Results: 2 fails; 4 and 6 work
Expected Results: 2 should fail with a better error, and so should 6.
4 is ok.
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.]