If you use LVM frequently enough, especially when re-using existing disks, you might come a cross a problem when you’re unable to create a physical volume from that disk. For example, here is what I encountered today when I tried to create a physical volume on a device called /dev/sdb
.
[root@db3 ~]# pvcreate /dev/sdb
Device /dev/sdb excluded by a filter.
I’m sure I haven’t had any filters in /etc/lvm/lvm.conf
.
To fix this, I needed to wipe the signature from this device with wipefs
command.
[root@db3 ~]# wipefs -a /dev/sdb
/dev/sdb: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sdb: 8 bytes were erased at offset 0x18fffffe00 (gpt): 45 46 49 20 50 41 52 54
/dev/sdb: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sdb: calling ioctl to re-read partition table: Success
Finally, I was able to create the physical volume on /dev/sdb
.
[root@srsdb3 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
Reference: