Solved Strange behaviour of 'allow' ?

I am currently developing a backup script that is using send/receive to backup my datasets. Currently I have my battle with the delegation using 'zfs allow' See the following log:

zfs send -LVcR -i @Friday storage/RPI@Dienstag | zfs receive -F zbackup/RPI-backup
Code:
full send of storage/RPI@Dienstag estimated size is 5,02M
full send of storage/RPI@Dienstag estimated size is 5,02M
cannot mount 'zbackup/RPI-backup': Insufficient privileges
zfs allow zbackup/RPI-backup
Code:
---- Permissions on zbackup ------------------------------------------
Local+Descendent permissions:

        user martin bookmark,compression,create,destroy,hold,mount,mountpoint,receive,rename,send,snapshot,userprop
sudo zfs allow -ldu martin create,destroy,mount,receive,rename,send,snapshot,hold,compression,mountpoint,bookmark,userprop zbackup/RPI-backup
zfs allow zbackup/RPI-backup
Code:
---- Permissions on zbackup/RPI-backup -------------------------------
Local+Descendent permissions:
        user martin bookmark,compression,create,destroy,hold,mount,mountpoint,receive,rename,send,snapshot,userprop
---- Permissions on zbackup ------------------------------------------
Local+Descendent permissions:
        user martin bookmark,compression,create,destroy,hold,mount,mountpoint,receive,rename,send,snapshot,userprop
zfs send -LVcR -i @Friday storage/RPI@Dienstag | zfs receive -F zbackup/RPI-backup
Code:
full send of storage/RPI@Dienstag estimated size is 5,02M
full send of storage/RPI@Dienstag estimated size is 5,02M
cannot receive new filesystem stream: destination has snapshots (eg. zbackup/RPI-backup@Dienstag)
must destroy them to overwrite it
warning: cannot send 'storage/RPI@Dienstag': signal received
zfs destroy zbackup/RPI-backup@%
zfs send -LVcR -i @Friday storage/RPI@Dienstag | zfs receive -F zbackup/RPI-backup
Code:
full send of storage/RPI@Dienstag estimated size is 5,02M
full send of storage/RPI@Dienstag estimated size is 5,02M
cannot mount 'zbackup/RPI-backup': Insufficient privileges
And here "the snake bit its tail" - the allow on zbackup/RPI-backup permissions seem gone. Also a bit strange, that the snapshot is created and on the same insufficient privileges are mentioned.
(BTW my privileges on storage are the same )
Any hints, what could be wrong ?
 
ARRGGGHHH !
I found the solution: I upgraded the kernel and did reboots and so vfs.usermount was reset to 0 . A short sudo sysctl vfs.usermount=1 fixed the problem.
 
Add it to /etc/sysctl.conf:
Code:
vfs.usermount=1
So it gets applied every time the machine boots.

Yes, I did. Reading the man pages, it was not clear for me whether to add it to the /boot/loader.conf.local or to /etc/sysctl.conf as both are mentioned under sysctl(8)(). But it looks like /etc/sysctl.conf is the right place to go.
 
Most sysctls that can be applied "on-the-fly" can be put in /etc/sysctl.conf. Some are read-only and can only be set before booting the kernel, those need to go in /boot/loader.conf.
 
Back
Top