[linux-lvm] confused with lvm2 filter rules
Heming Zhao
heming.zhao at suse.com
Thu Jun 6 08:16:47 UTC 2019
Hello,
BTW,
Only vgextend doesn't work, which must be a bug. It looks the filter
handling codes have bug.
Regards,
zhm
On 6/5/19 6:20 PM, Zdenek Kabelac wrote:
> Dne 03. 06. 19 v 15:03 Heming Zhao napsal(a):
>> Hello,
>>
>> I met below filter action when executed 'vgextend'.
>> why the filter take no effect on executing pvcreate or vgcreate?
>
>> # rpm -qa | grep lvm2
>> lvm2-clvm-2.02.180-8.16.x86_64
>> lvm2-cmirrord-2.02.180-8.16.x86_64
>> lvm2-2.02.180-8.16.x86_64
>>
>> the filter rules: (you can see all the disk in /dev/disk/by-id/ are
>> rejected)
>> # grep filter /etc/lvm/lvm.conf | grep -v "#"
>> filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|",
>> "r|/dev/fd.*|", "r|/dev/cdrom|", "a/.*/" ]
>
>
> Hi
>
> Filter with 'a|.*|' at the end will almost always never work.
> As devices do have several names so if you reject it by one name,
> you will likely accept it with another name.
>
>
> So I'd highly recommend only these 2 variants that are 'easy to follow'.
>
>
> 1. White-list devices you want to see and add r|.*| as the last rule.
> ^^^^^^^^^^^^^^^ most recommended.
>
> 2. Pure list of reject rules (do not add any 'a' rule).
>
> Regards
>
> Zdenek
>
>
>
More information about the linux-lvm
mailing list