During a recreation of an LVM Volume Group on a new machine, I noticed that the drives weren’t being accepted by pvcreate when initializing them. My drives weren’t RAID configured, as they are simply /dev/sdb,c,d,e,f,g, etc. The error thrown when “pvcreate /dev/sd#” was “Device /dev/sd# not found (or ignored by filtering).” (replacing # with the drive name such as sda1)
What I did was edit the /etc/lvm/lvm.conf file, and change the filter to accept the sd scsi drives.
I went the redneck approach and slapped a bunch of letters in to cover anything that could exist, but I’m sure there are other ways. This is my filter line:
filter = [ “a|drbd.*|”, “a|sda3|”, “a|sd[bcdefghijklmnopqrstuvwxyz]|”, “r|.*|” ]
Note: sda3 is being used for a system partition and is being rejected in this line as well.
That fixed it, and pvscan detected the drive, and pvcreate was able to access it.
I’ve received quite a few reader alerts telling me to use partitions, along with the comments already posted seeming to say the same thing indirectly. I wanted to alert those that are unaware that you can include an entire disk into a Volume Group without partitions. Since the entire disk will be used, partitions would be redundant. That is not the cause of the filtering issue, since I’ve experimented with partitions for 2-3 minutes when I had this issue with the same outcome.
I’d also like to add a page from the documentation for CentOS that talks about LVM filtering:
While it’s for CentOS 5, the syntax on LVM has remained the same for quite a few years.