Vgextend : "device excluded by a filter"
Solution 1:
For me, the problem is my /dev/sdb is a GPT partitioned disk. You need to wipe off the GPT records. LVM filters such devices out
Run wipefs -a /dev/sdi
first to remove any FS/GPT signatures.
Solution 2:
In my case I had this problem:
[root@test ~]# pvcreate /dev/vdb
Device /dev/vdb excluded by a filter.
[root@test ~]# pvcreate /dev/vdb -vvv
...
/dev/vdb: size is 385 sectors
/dev/vdb: Skipping: Too small to hold a PV
Closed /dev/vdb
...
So I checked the size of the disk and surprise:
[root@test ~]# fdisk -l /dev/vdb
Disk /dev/vdb: 0 MB, 197120 bytes, 385 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
To fix this I did the following:
Initially when I created the disk I've created it using this command:
[root@kvmserver ~]# virsh attach-disk test --source /secret/test_disk1 --target vdb --persistent
Which was wrong, so I did a lil bit of reading and found out dat I have to use a driver for it (becaue of imagine metadata) so I did the following:
[root@kvmserver ~]# virsh detach-disk test /secret/test_disk1 --config Disk detached successfully
[root@kvmserver ~]# virsh attach-disk test --source /secret/test_disk1 --target vdb --persistent --subdriver qcow2
Disk attached successfully
Now everything is ok:
[root@test ~]# fdisk -l /dev/vdb
Disk /dev/vdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@test ~]# pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created.
Solution 3:
In my case
root@VirtualBox:~# pvcreate /dev/sdd /dev/sdc
Device /dev/sdd excluded by a filter.
Device /dev/sdc excluded by a filter.
solution is: check if there is no partition of the disk. if there are, write the name of the partition.
root@VirtualBox:~# pvcreate /dev/sdd1 /dev/sdd2 /dev/sdc1 /dev/sdc2 /dev/sdc3
WARNING: ext4 signature detected on /dev/sdc1 at offset 1080. Wipe it? [y/n]: y
Wiping ext4 signature on /dev/sdc1.
Physical volume "/dev/sdd1" successfully created.
Physical volume "/dev/sdd2" successfully created.
Physical volume "/dev/sdc1" successfully created.
Physical volume "/dev/sdc2" successfully created.
Physical volume "/dev/sdc3" successfully created.
Solution 4:
Another possibility; I ran into this today. A pvcreate on my /dev/sdb came back with "...excluded by a filter." No filters in lvm.conf and the size was fine. But the -vvv option recommended by @Zatarra helped. In it I saw,
Closed /dev/sdb
/dev/sdb: Skipping: Partition table signature found
lsblk showed no partitions and fdisk wasn't helpful. But gdisk showed there was GPT partitioning information written to the device. A dd to it probably would have worked - but I used the "zap" option under expert functionality in gdisk (danger!).
Good to go after that.
Solution 5:
Check /etc/lvm/lvm.conf
for uncommented filter =
and global_filter =
lines. One of these will likely contain some filter which matches /dev/sdb
. The default configuration specifies no filters, so this will have been modified in your environment by someone else.