[linux-lvm] filter problem

Wim Bakker wim at unetix.nl
Fri Aug 30 05:36:01 UTC 2002


On Thursday 29 August 2002 15:35, Joe Thornber wrote:

> I think there's some confusion about what vgscan will be doing and
> where the filters fit in.  Certainly I just had to look at the code to
> remind myself:
>
> vgscan will stat *every* device under the /dev tree (or elsewhere if
> you've specified a different dev dir).
>
> If the device is a block device it will then pass it through the
> predicate functions/filters in the following order:
>
> i.  Regex - is the device accepted by the regexs specified in lvm.conf?
>
> ii.  LVM check - is this device a 'recognised' device type. eg, IDE,
> md, loop etc.
>
> iii. Is it a valid partition number.
>
> iv.  Can I successfully open the device
>      *** This is the expensive operation for non existent devs ***
>
> Personally I see no need for checks ii. and iii. they will probably
> disappear.
>
> So with your filter which accepts every device containing 'sda' you
> will find that /dev/ide0 is 'stat'd but no more than this.  However
> with /dev/sda8 (non existent) you will get as far as the open test
> before being rejected.
>
> Once vgscan has been run the tools will not even stat failed devices.
>
> NOTE: You don't always need to run vgscan on startup with LVM2,
> only if you know some devices have moved - I just run 'vgchange -ay' in
> my init script.
>
> - Joe

Thanks for the explanation, it's clear now what's happening.

Wim Bakker





More information about the linux-lvm mailing list