Device dev md0 not found (or ignored by filtering).

Posted by Dark Training on April 8, 2011 tags: | linux

I recently had a "duh" moment and I thought I would share in case this ever happens to you.

I was working on a server that I had just created a software raid (mdadm) on two large disks after using parted first to assign them as gpt.

When I went to use the pvcreate command I got the following error:

Device /dev/md0 not found (or ignored by filtering).

I was kind of stumped for a moment, the filter in my lvm conf had never needed to be modified before, what did I do wrong? So I started tracing back my steps all the way to when I created the raid, and thats when I saw the mistake I had made, I had built the raid on the drive, not the partition (IE /dev/sda not /dev/sda1).

Here is the fix:

parted /dev/sda
rm 1
mkpart primary 0 100%
quit

#parted /dev/sdb
rm 1
mkpart primary 0 100%
quit

#/sbin/mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda1 /dev/sdb1

#/usr/sbin/pvcreate /dev/md0

Bingo! The physical volume was created. Hope this helps someone else, if it does leave me a note below.