linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] LVM filter ignored?
@ 2016-12-29 20:28 knebb
  2017-01-02 15:06 ` Zdenek Kabelac
  0 siblings, 1 reply; 4+ messages in thread
From: knebb @ 2016-12-29 20:28 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]

Hi all,

I am using LVM for several years but now I face an issue where I have no
clue how to deal with.

I want to have a VG on top of a drbd device (Distributed Replicated
Block Device) which should not be an issue according to docs:
https://www.drbd.org/en/doc/users-guide-83/s-lvm-drbd-as-pv

Unfortunately I am always getting "duplicate device" errors as LVM
recons a pv on /dev/sdb (underlying device for drbd) as well as on
/dev/drbd0

Now I tried to configure filters to match my setup. But it seems I do
not understand the filter rules.

I need to enable /dev/sda incl. all partitions. (for root)
I need to disable /dev/sdb at all as it is the device for drbd!
I need to enable /dev/drbd0 as the "real" PV.
I can disable all others.

So I tried:
filter = [ "r|sdb.*/|","a|drbd0/|","a|.*/|" ]

Which results in the duplicate-issue:
[root@backuppc ~]# pvcreate /dev/drbd0
  Physical volume "/dev/drbd0" successfully created.
[root@backuppc ~]# pvscan --cache
  WARNING: PV eEpd0B-VaET-V2mH-9InB-pYab-P5Bp-hjfOhh on /dev/sdb was
already found on /dev/drbd0.
  WARNING: Disabling lvmetad cache which does not support duplicate PVs.
  WARNING: Not using lvmetad because duplicate PVs were found.


So anyone having an idea what is wrong with my filter config? As the
docs are very unclear about the exact syntax I did as well some other
versions but no one leads to the resul I want to have...

So what are correct filter rules?

Greetings

/christian


[-- Attachment #2: Type: text/html, Size: 2168 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] LVM filter ignored?
  2016-12-29 20:28 [linux-lvm] LVM filter ignored? knebb
@ 2017-01-02 15:06 ` Zdenek Kabelac
  2017-01-02 19:20   ` knebb
  0 siblings, 1 reply; 4+ messages in thread
From: Zdenek Kabelac @ 2017-01-02 15:06 UTC (permalink / raw)
  To: LVM general discussion and development

Dne 29.12.2016 v 21:28 knebb@knebb.de napsal(a):
> Hi all,
>
> I am using LVM for several years but now I face an issue where I have no clue
> how to deal with.
>
> I want to have a VG on top of a drbd device (Distributed Replicated Block
> Device) which should not be an issue according to docs:
> https://www.drbd.org/en/doc/users-guide-83/s-lvm-drbd-as-pv
>
> Unfortunately I am always getting "duplicate device" errors as LVM recons a pv
> on /dev/sdb (underlying device for drbd) as well as on /dev/drbd0
>
> Now I tried to configure filters to match my setup. But it seems I do not
> understand the filter rules.
>
> I need to enable /dev/sda incl. all partitions. (for root)
> I need to disable /dev/sdb at all as it is the device for drbd!
> I need to enable /dev/drbd0 as the "real" PV.
> I can disable all others.
>
> So I tried:
> filter = [ "r|sdb.*/|","a|drbd0/|","a|.*/|" ]
>


Hi

Just check the 'comment' for filters in lvm.conf -
there is stated you should NOT mix  'r' & 'a' together
(there is even no need for this in 99.9999%)

So please focus on keeping things simple:

- either use plain list of rejects  'r'
- or set 'white-list' with all 'a'  finished with 'r .*'

Every other usage does require quite good understanding how
the devices are scanned and how many accessible paths for them
exists in today's /dev directory.

To to be exact in your case:

Use just:    [ "r|/dev/sdb|" ]

OR  (if you want to use just drdb0) :

[ "a|drbd0/|", "r|.*/|" ]

(eventually add more 'a' with more PV devices you have)


Regards

Zdenek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] LVM filter ignored?
  2017-01-02 15:06 ` Zdenek Kabelac
@ 2017-01-02 19:20   ` knebb
  2017-01-02 20:18     ` Zdenek Kabelac
  0 siblings, 1 reply; 4+ messages in thread
From: knebb @ 2017-01-02 19:20 UTC (permalink / raw)
  To: linux-lvm

Hi,


>> So I tried:
>> filter = [ "r|sdb.*/|","a|drbd0/|","a|.*/|" ]
>>
>
> Just check the 'comment' for filters in lvm.conf -
> there is stated you should NOT mix  'r' & 'a' together
> (there is even no need for this in 99.9999%)
>
Well....it writes "be careful mixing" but in the examples mixing is
shown. Appeared not to be soooo important.

> - either use plain list of rejects  'r'
> - or set 'white-list' with all 'a'  finished with 'r .*'
>
> To to be exact in your case:
>
> Use just:    [ "r|/dev/sdb|" ]
>
I set this not as you recommended and indeed it appears to be working,
Thanks, even I do not have a clue what I did wrong as I remember I had
it this way. But I moght be wrong as it did not work as I configured it.

Thanks a lot, looks great now!

/CHRISTIAN

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] LVM filter ignored?
  2017-01-02 19:20   ` knebb
@ 2017-01-02 20:18     ` Zdenek Kabelac
  0 siblings, 0 replies; 4+ messages in thread
From: Zdenek Kabelac @ 2017-01-02 20:18 UTC (permalink / raw)
  To: LVM general discussion and development

Dne 2.1.2017 v 20:20 knebb@knebb.de napsal(a):
> Hi,
>
>
>>> So I tried:
>>> filter = [ "r|sdb.*/|","a|drbd0/|","a|.*/|" ]
>>>
>>
>> Just check the 'comment' for filters in lvm.conf -
>> there is stated you should NOT mix  'r' & 'a' together
>> (there is even no need for this in 99.9999%)
>>
> Well....it writes "be careful mixing" but in the examples mixing is
> shown. Appeared not to be soooo important.

Yep looking at the example it's actually bad one ;) will be fixed.

>
>> - either use plain list of rejects  'r'
>> - or set 'white-list' with all 'a'  finished with 'r .*'
>>
>> To to be exact in your case:
>>
>> Use just:    [ "r|/dev/sdb|" ]
>>
> I set this not as you recommended and indeed it appears to be working,

When you reject a device - and then you accept everything - device will
be accepted via 'different' link/mknod whatever it finds...
And there are now many links to reference the same device.

When you just reject  sdb  - you will reject all it's symlink (implicit)
But when you then in the same filter row later  'accept'  sdb as some 
'/dev/disk-by...' you explicitly overrule this 'implicit' reject.

By default what is NOT reject is 'accepted' by default in sence 'it's been
not rejected' by any previous filter.

It's almost similar to having explicit 'a|.*|' at the end, but will not accept 
rejected 'implicit' symlinks ;)

OK - enough - I'm pretty sure noone can actually understand this :)

Clear message is -  use  either  WHITE-LIST,  or  plain REJECT LIST
follow this rule and you have always clear logic.

That's basically all you need ;)


> Thanks, even I do not have a clue what I did wrong as I remember I had
> it this way. But I moght be wrong as it did not work as I configured it.

As said - it's hard to explain :)
And no - I've not been designing this logic...

Regards

Zdenek

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-02 20:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-29 20:28 [linux-lvm] LVM filter ignored? knebb
2017-01-02 15:06 ` Zdenek Kabelac
2017-01-02 19:20   ` knebb
2017-01-02 20:18     ` Zdenek Kabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).