5.5. Controlling LVM Device Scans with Filters
vgscancommand is run to scan the block devices on the system looking for LVM labels, to determine which of them are physical volumes and to read the metadata and build up a list of volume groups. The names of the physical volumes are stored in the LVM cache file of each node in the system,
/etc/lvm/cache/.cache. Subsequent commands may read that file to avoiding rescanning.
lvm.confconfiguration file. The filters in the
lvm.conffile consist of a series of simple regular expressions that get applied to the device names that are in the
/devdirectory to decide whether to accept or reject each block device found.
a/loop/is equivalent to
a/.*loop.*/and would match
filter = [ "a/.*/" ]
filter = [ "r|/dev/cdrom|" ]
filter = [ "a/loop.*/", "r/.*/" ]
filter =[ "a|loop.*|", "a|/dev/hd.*|", "r|.*|" ]
filter = [ "a|^/dev/hda8$|", "r/.*/" ]
lvmetaddaemon is running, the
filter =setting in the
/etc/lvm/lvm.conffile does not apply when you execute the
pvscan --cache devicecommand. To filter devices, you need to use the
global_filter =setting. Devices that fail the global filter are not opened by LVM and are never scanned. You may need to use a global filter, for example, when you use LVM devices in VMs and you do not want the contents of the devices in the VMs to be scanned by the physical host.
lvm.conffile, see Appendix B, The LVM Configuration Files and the
lvm.conf(5) man page.