How to fix LVM Device /dev/sdb excluded by a filter.

When creating a new PV device using a previously partitioned disk, you may see the following error message.

[email protected]:~/ $ sudo pvcreate /dev/sdb
  Device /dev/sda excluded by a filter.
[email protected]:~/

Pre-requisites

Resolution

Confirm that you have selected the correct disk.

This is a safety measure in LVM to prevent you from adding a disk that already has a partition table and filesystem.

sudo fdisk -l /dev/sdb

If you are should that you have the correct disk, we have wipe out the old partition table using wipefs.

sudo wipefs -a /dev/sdb

Now, you should be able to create the PV device without issue.

[email protected]:~#  pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created.
[email protected]:~# pvdisplay
  "/dev/sda" is a new physical volume of "120 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb
  VG Name
  PV Size               120 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               lxtVCs-2OLD-HXMh-HAfY-ipa4-TXBe-EIamF6

[email protected]:~#
comments powered by Disqus