On Red Hat Enterprise Linux 4 and Red Hat Enterprise Linux 5, 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 the filter keyword is shown below:
[server][root][~]# 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.
NOTE: Be sure to only specify one filter line in /etc/lvm/lvm.conf since only one filter pattern is expected.
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.
[server][root][~]# vgscan -vvvv