main/lvm2: device node instead of symlink
Hello, I am not sure if that's an issue with lvm or eudev, but here it is:
Exposition
I am on Alpine Edge, with lvm2 installed. I have a non-root secondary disk that I'm using for LVM tests purposes. I didn't enable lvm feature in mkinifs features.
On traditional distributions logical volumes (when activated) are available through at least 3 device paths (that I'm aware of):
-
/dev/dm-*
which is the actual device node and is owned byroot:disk
mode 660 -
/dev/mapper/*
which is symlinked to/dev/dm-*
-
/dev/<vgname>/*
which is also a symlink to/dev/dm-*
On Alpine, without eudev installed:
-
/dev/dm-*
if an actual device node owned byroot:root
mode 600 -
/dev/mapper/*
is also a device node owned byroot:root
mode 600 -
/dev/<vgname>/*
is a symlink to/dev/mapper/*
On Alpine, with eudev and device-mapper-udev installed and running:
-
/dev/dm-*
if an actual device node owned byroot:wheel
mode 660 -
/dev/mapper/*
is also a device node owned byroot:root
mode 600 -
/dev/<vgname>/*
is a symlink to/dev/mapper/*
Notice that in either cases on Alpine (with or without eudev), /dev/mapper/*
is not a symlink, and /dev/<vgname>/*
is symlinked to /dev/<vgname>/*
instead of /dev/dm-*
. Also /dev/mapper/*
is always owned by root:root
.
Problem
This is problematic for at least the following reason:
I want to use lvmlockd with sanlock to be able to make use of shared volume groups between multiple hosts. In order to manage locks, lvmlockd queries sanlock by giving it the path of the special logical volume lvmlock
where locks are written. The path given to sanlock by lvmlock is /dev/mapper/<vgname>-lvmlock
which is owned by root:root
as we saw earlier. As sanlock is traditionally running by a dedicated user which is in the disk
group, it fails to do anything.
Workaround
I ended up by running sanlock as root, which is far from ideal.