On a CentOS/RHEL system LVM2 can be configured via the /etc/lvm/lvm.conf file to exclude devices that the volume manager is not allowed to access. To exclude a list of devices, use the filter keyword to specify a list of accessible devices. An example of this command is shown below:
# grep filter /etc/lvm/lvm.conf filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]
Pattern matching is based on the following logic:
- If any name matches any ‘a’ pattern, the device is accepted
- Otherwise if any name matches any ‘r’ pattern it is rejected
- Otherwise it is accepted.
After changes are made to the lvm configuration file, it will be necessary to run the command vgscan in order for the changes to become active. Shown below is an example of running vgscan in extended debug output mode to activate the changes in the configuration file.
# vgscan -vvv