[zfs-discuss] zvol access rights - chown zvol on reboot / startup / boot

2012-11-15 Thread Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
When I google around for anyone else who cares and may have already solved the 
problem before I came along - it seems we're all doing the same thing for the 
same reason.  If by any chance you are running VirtualBox on a solaris / 
opensolaris / openidiana / whatever ZFS host, you could of course use .vdi 
files for the VM virtual disks, but a lot of us are using zvol instead, for 
various reasons.  To do the zvol, you first create the zvol (sudo zfs create 
-V) and then chown it to the user who runs VBox (sudo chown someuser 
/dev/zvol/rdsk/...) and then create a rawvmdk that references it (VBoxManage 
internalcommands createrawvmdk -filename /home/someuser/somedisk.vmdk -rawdisk 
/dev/zvol/rdsk/...)

The problem is - during boot / reboot, or anytime the zpool or zfs filesystem 
is mounted or remounted, export, import...  The zvol ownership reverts back to 
root:root.  So you have to repeat your sudo chown before the guest VM can 
start.

And the question is ...  Obviously I can make an SMF service which will chown 
those devices automatically, but that's kind of a crappy solution.

Is there any good way to assign the access rights, or persistently assign 
ownership of zvol's?
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zvol access rights - chown zvol on reboot / startup / boot

2012-11-15 Thread Geoff Nordli
On 12-11-15 11:57 AM, Edward Ned Harvey 
(opensolarisisdeadlongliveopensolaris) wrote:


When I google around for anyone else who cares and may have already 
solved the problem before I came along - it seems we're all doing the 
same thing for the same reason.If by any chance you are running 
VirtualBox on a solaris / opensolaris / openidiana / whatever ZFS 
host, you could of course use .vdi files for the VM virtual disks, but 
a lot of us are using zvol instead, for various reasons.To do the 
zvol, you first create the zvol (sudo zfs create -V) and then chown it 
to the user who runs VBox (sudo chown someuser /dev/zvol/rdsk/...) and 
then create a rawvmdk that references it (VBoxManage internalcommands 
createrawvmdk -filename /home/someuser/somedisk.vmdk -rawdisk 
/dev/zvol/rdsk/...)


The problem is - during boot / reboot, or anytime the zpool or zfs 
filesystem is mounted or remounted, export, import...The zvol 
ownership reverts back to root:root.So you have to repeat your sudo 
chown before the guest VM can start.


And the question is ...Obviously I can make an SMF service which will 
chown those devices automatically, but that's kind of a crappy solution.


Is there any good way to assign the access rights, or persistently 
assign ownership of zvol's?





Instead of using vdi, I use comstar targets and then use vbox built-in 
scsi initiator.



Geoff
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss