Pvcreate not detecting harddrives (Device /dev/abc not found (or ignored by filtering).

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.

 

EDIT 10/3/2014:

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:
http://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/lvm_filters.html
While it’s for CentOS 5, the syntax on LVM has remained the same for quite a few years.

Advertisements

9 thoughts on “Pvcreate not detecting harddrives (Device /dev/abc not found (or ignored by filtering).

  1. The problem is that the filter will not allow it to recognize the partition. While troubleshooting, I ran through the following partition types: lvm, linux, msdos, bsd. Once the filter is repaired in /etc/lvm/lvm.conf, pvcreate recognizes the disk(s).

  2. Just type fdisk /dev/sd? enter c,u,n,p,accept default cylinders and give a size for your disk. I struggled with this for a couple of days before my memory returned. Good Luck.

  3. All that does is turn off the dos compatibility flag which is good practice for LVM, but not related to this problem. The rest of those flags are simply for adding a new partition. What is this meant to fix?
    Thanks for the post!

  4. Hi
    I ran into this as well. I read it was caused by an empty GPT partition table. I zeroed out the partition table as so and i was able to run pvcreate successfully

    dd if=/dev/zero of=/dev/sdX bs=512 count=1

    http://serverfault.com/a/528378
    It looks like their are other solutions posted there as well

  5. Thanks for sharing! I’ll test this out the next time I run into this issue. It’s nice to know you’ve found a work around and others that have the same issue as well.

  6. There is an easier way.

    Just run pvcreate with “very very verbose” mode (-vvv ore -vvvv). You will see an error message like “Skipping: Unrecognised LVM device type 8”. You can look up the device type of that magic number in /proc/devices. Then add the type and magic number to /etc/lvm/lvm.conf:

    types = [ “TYPE”, number ]

    Done!

  7. Thanks for sharing that, Phillipp. If I run into this issue again, I’ll definitely use that method.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s