From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Soltys Date: Mon, 15 Dec 2008 16:13:22 +0000 Subject: Re: udev lvm permisions Message-Id: <49468222.90403@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: > > I've created this rule but it applies to the kernel device... /dev/dm-*. > What I need is a rule that changes the ownership > of /dev/mapper/HomeVolume. > > Thats where I stand now, > so any suggestions are welcome! > As I corrected myself earlier - if you really need udev to do so, you need rules file that will create the names as lvm would do. Or you can extend a bit the above rules and make udev create that particular device with the name you want, e.g. ENV{DM_UUID}="", NAME:="" GROUP="users", MODE="0660" This guarantees that no rule later will alter the name. It also assumes you're using udev>1 and nothing earlier did NAME:= (with 130 and earlier, any earlier NAME= or NAME:= assignment was final). Then - just use /dev/ to access your volume however you need. Or ... you can just add simple chown / chmod somewhere after lvm is activated (not very flexible, but definitely simple). Anyway - I needed similar thing at one of my machines, where squid cache uses coss storage. Squid runs unprivileged, but had to access coss device directly. I use rules mimicking lvm/dmsetup behaviour though, so simple NAME= test was enough in my case. If you're curious - http://marc.info/?l=linux-hotplug&m2165542423023&q=p3 With that, I have ACTION="add|change", SUBSYSTEM="block", NAME="mapper/vg0-coss", \ OWNER="squid", GROUP="squid" Good luck