Pete Zaitcev (zaitcev) wrote,
Pete Zaitcev

Today, I hate... Alasdair!

There was no update to the long and storied series of hate-by-surprise in a while... but never fear and behold:

[root@niphredil zaitcev]# pvcreate -f /dev/uba4
  Device /dev/uba4 not found (or ignored by filtering).
[root@niphredil zaitcev]# echo usb-storage > \
[root@niphredil zaitcev]# rmmod ehci_hcd && modprobe ehci_hcd
[root@niphredil zaitcev]# pvcreate -f /dev/sdb4
  Physical volume "/dev/sdb4" successfully created
[root@niphredil zaitcev]# 

The anguish and googling occured after the first command, but I'm omitting the depiction of it for brievity. There is no way to disable the mysterious filtering, or even know what is being filtered and why, but fortunately sd was available.

BTW, the output of strace pvcreate is not for the easily scared. The stupid thing invokes stat(2) on every node in /dev.

UPDATE: Commenters en masse pointed me to lvm.conf, which is natural, but... wrong! The message is misleading, my lvm.conf does not filter (Fedora ships with filter = [ "a/.*/" ]). The pvcreate rejects ub because of some built-in filtering.

MORE: Robin comments:

The rest of the commenters here are only partially right in saying that it's got to do with the filters. There is a lot more to the filters than the regular expressions.

1. Your device must show up in sysfs under one of: /sys/subsystem/block/devices, /sys/class/block or /sys/block/. This is controlled by the config option devices/sysfs_scan. (is optional)

2. It should match the regex as defined in config setting devices/filter. (is optional)

3. The major of the device is taken against block devices from /proc/devices, and the name of the type listed in that file MUST appear in the device_info array. This check is NOT optional.

4. It should not be detected as a MD raid component, if config setting devices/md_component_detection is enabled. (is optional)

In this case, ub isn't in the device_info array. Here's a patch, if it works for you, please add your signoff and pass it to agk.

I changed the number of partitions to 8 in my version of Robin's patch, and everything seems to work now.

LATER: Alasdair e-mailed in reply to Robin's patch submission:

1. You can add entries to lvm.conf without having to recompile. (Look for 'types' in the example conf file).
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded