LVM Block device filter with multipathd and lvm

If you use a multipathd & lvm setup with a ACTIVE-PASSIVE redundant SAN (ex: EMC VNX) and if you use both SPs (storage processors) in the multipathd for additional redundancy you will get I/O errors in some block devices.

This happens because LUNs will only be announced by the passive SP in case of failure, this provokes I/O errors if you run a pvscan or vgscan since theres no LUNs being announced in the passive SP block devices.

Adding a filter in /etc/lvm/lvm.conf like this: filter = [ “r/disk/”, “r/sd.*/”, “a/.*/” ]

Using this filter lvm will not use sd* block devices, using only mpath* devices which are the ones you want, removing the I/O errors from the logs.