[Hampshire] LVM device node permissions

Top Page
Author: Hugo Mills
Date:  
To: Hants LUG
Subject: [Hampshire] LVM device node permissions

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x584d8100.hantslug.org.uk.32750': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Tue Nov 13 17:08:07 2007 GMT
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
Does anyone know if it's possible to set persistent device node
permissions on LVM volumes? I have a few volumes in my LVM which I
want to give access to an "ordinary" user without giving access to all
the other volumes.

I have a group called "kvm", to which my target user(s) belong.
Thus, I want to set up the following permissions:

hrm@willow:~/iso$ ls -l /dev/mapper
total 0
crw------- 1 root root 10, 63 2007-11-06 10:20 control
brw-rw---- 1 root disk 254, 6 2007-11-06 10:20 primary-home
brw-rw---- 1 root disk 254, 0 2007-11-06 10:20 primary-root
[...]
brw-rw---- 1 root kvm 254, 7 2007-11-13 16:51 primary-vm--winxp

The ownership of everything by "disk" is done automatically by the
LVM. However, short of modifying the initscripts for LVM to set the
permissions explicitly, I can't see how to get it to set group
ownership for just the volumes I want.

I've looked at udev, but it doesn't get told about the creation of
device nodes in /dev/mapper (it gets told about /dev/dm-<n>, but
that's useless), so udev is not the solution.

Anyone got any ideas?

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
  --- "He's a nutcase, you know. There's no getting away from it -- ---  
                     he'll end up with a knighthood"