From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heming Zhao Date: Thu, 6 Jun 2019 08:16:47 +0000 Message-ID: <4e175852-fd38-2096-a174-046e10af941f@suse.com> References: <3cc84c6a-62d0-96c2-cf6e-9181577f9802@suse.com> <662c133e-cebe-1882-a086-edb2219af7f0@redhat.com> In-Reply-To: <662c133e-cebe-1882-a086-edb2219af7f0@redhat.com> Content-Language: en-US Content-ID: <7AFDC530A3779C498200323E99958B8B@namprd18.prod.outlook.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [linux-lvm] confused with lvm2 filter rules Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="utf-8" To: Zdenek Kabelac , LVM general discussion and development 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 > > >