[linux-lvm] what creates the symlinks in /dev/<volgroup> ?

Chris Friesen chris.friesen at windriver.com
Wed Jun 22 14:52:04 UTC 2016


On 06/22/2016 03:23 AM, Zdenek Kabelac wrote:
> Dne 21.6.2016 v 17:22 Chris Friesen napsal(a):
>> I'm using the stock CentOS7 version, I think.
>>
>>   LVM version:     2.02.130(2)-RHEL7 (2015-12-01)
>>   Library version: 1.02.107-RHEL7 (2015-12-01)
>>   Driver version:  4.33.0
>>
>> So are you saying that nobody should run "vgscan --mknodes" on a system where
>> udev is managing the symlinks?
>
> Yes - on such system this command should be used only in case of 'emergency',
> udev doesn't work properly and you need links.
>
> The links however will not be known to udev and likely whole system is
> going to be crashing soon or is misconfigured in major way.

Okay, I'll see if I can get the call to vgscan removed.  But even so wouldn't it 
make sense to have vgscan use the same logic as udev in terms of what symlinks 
to make and where to make them to?


>> I'm not sure what you're talking about as far as duplicates, I'm not seeing
>> any duplicate devices.  The problem I see is that "vgscan --mknodes" or
>> "vgmknodes" will both create an additional symlink when compared to the udev
>> rules, and the additional symlink is not deleted when I deactivate the volume
>> group.
>>
>> For what it's worth, in my lvm.conf I have "use_lvmetad = 0" and
>>
>> global_filter = [ "a|/dev/sda|", "a|/dev/drbd4|",  "a|/dev/sda6|", "r|.*|" ]
>
> And now we are getting to the point on your problem:
>
> "a|/dev/sda|"   will also match "a|/dev/sda6|"
> (and /dev/sda5...)
>
> If you would like to get only 'exact' '/dev/sda' you would need to use
>
> ^/dev/sda$
>
> otherwise '/dev/sda' may appear anywhere as substring of your device path.


Yes, the "/dev/sda" is intentional since we have multiple /dev/sda* devices that 
form part of various separate volume groups.  Really it's the /dev/sda6 that is 
extra here since it's already matched.

The problematic issue I'm seeing with udev/vgscan is actually with the volume 
group on /dev/drbd4.

I really don't think I'm having any problems with duplicates...just with vgscan 
creating extra symlinks compared to udev, that udev doesn't clean up.

Chris





More information about the linux-lvm mailing list