From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Soltys Date: Mon, 15 Dec 2008 11:35:00 +0000 Subject: Re: udev lvm permisions Message-Id: <494640E4.6000005@ziu.info> List-Id: References: <1229336451.19633.4.camel@linux-pqqd.site> In-Reply-To: <1229336451.19633.4.camel@linux-pqqd.site> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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="", OWNER="", GROUP="", MODE= 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}="", OWNER=, GROUP=, MODE= LABEL="dm_end" Then put it into some late-parsed udev rule. Note that uuid reported by dmsetup, will look like LVM- without any dashes.