Re: udev lvm permisions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Geert Geurts wrote:
Hello,
the permissions to the HomeVolume are not set correctly by Suse, so the
volume cannot be decrypted and cannot be mounted.
How can I create a udev rule that applies only to one LVM volume?


You could match by NAME, for example something similar to:

KERNEL=="dm*", ACTION=="add|change", SUBSYSTEM=="block", NAME=="<name assigned earlier>", OWNER="<something>", GROUP="<something>", MODE=<something>

But for that to work, you need some earlier udev rule setting actual name - stock udev rules have no device-mapper rules. So it's up to your distro's rules or your own. Alternatively, you could just match by uuid:

ACTION!="add|change", GOTO="dm_end"
KERNEL!="dm*", GOTO="dm_end"

PROGRAM="/sbin/dmsetup info -c --noheadings -o uuid -j%M -m%m", ENV{DM_UUID}="%c"

ENV{DM_UUID}=="<uuid of needed lvm volume>", OWNER=<something>, GROUP=<something>, MODE=<something>

LABEL="dm_end"

Then put it into some late-parsed udev rule. Note that uuid reported by dmsetup, will look like LVM-<vg uuid><lv uuid> without any dashes.
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux