Allowing ZFS Snapshots
pfexec zfs rollback rpool/vbox@clean
Fortunately, it is possible to delegate the permission to run ZFS commands to my user account using zfs allow. For example:
pfexec zfs allow bleonard snapshot,rollback,mount rpool/vbox
Note, the ability to 'mount' is required in order to create and rollback snapshots. See the zfs man page for details.
To see the permissions assigned to a file system:
bleonard@opensolaris:~$ zfs allow rpool/vbox ------------------------------------------------------------- Local+Descendent permissions on (rpool/vbox) user bleonard mount,rollback,snapshot -------------------------------------------------------------
Now rollbacks are a bit easier:
zfs rollback rpool/vbox@clean
You can delegate any of the zfs commands, including allow. For more details see Delegating ZFS Permissions.
That is the "right" way to do it.
However you could also use the "alias" builtin command in bash to alias "zfs" to "pfexec zfs".
e.g. put the line:
alias zfs="pfexec zfs"
in your .profile or .bashrc ; then logout and login (or start a new terminal window if in a GUI).
Posted by patrick giagnocavo on February 04, 2009 at 03:12 AM GMT #