I'm stumped here - trying to delegate a zfs dataset to a jail (using another pool) within iocage...
My config has what appear to be all the proper settings to allow a root user in the jail to manage zfs, and it all seems to work, but I cannot unmount any datasets.
Here's the config:
I have the various sysctl-related settings, lowered "enforce_statfs" to 0 (also was trying with 1), and I run some "exec_created" hooks here to ensure that the dataset has the "jailed" parameter enabled and to tie the jail and dataset together.
It seems to work in every other way. I can create new datasets in the jail, destroy them, create snapshots, etc. It's just the unmount that fails (both 'zfs unmount data/jail-mounts/zfsmount' and 'umount /jailmount').
I'm totally not sure what I'm doing wrong here or if this is just some weird zfs/jail bug.
My config has what appear to be all the proper settings to allow a root user in the jail to manage zfs, and it all seems to work, but I cannot unmount any datasets.
Here's the config:
JSON:
{
"allow_mount": 1,
"allow_mount_devfs": 1,
"allow_mount_zfs": 1,
"basejail": 1,
"boot": 1,
"enforce_statfs": "0",
"exec_created": "zfs set jailed=on data/jail-mounts/zfsmount; zfs jail ioc-zfsmount data/jail-mounts/zfsmount
",
"host_hostname": "zfsmount",
"host_hostuuid": "zfsmount",
"last_started": "2021-11-09 00:22:58",
"release": "12.2-RELEASE-p10"
}
I have the various sysctl-related settings, lowered "enforce_statfs" to 0 (also was trying with 1), and I run some "exec_created" hooks here to ensure that the dataset has the "jailed" parameter enabled and to tie the jail and dataset together.
It seems to work in every other way. I can create new datasets in the jail, destroy them, create snapshots, etc. It's just the unmount that fails (both 'zfs unmount data/jail-mounts/zfsmount' and 'umount /jailmount').
Code:
root@zfsmount:~ # mount | grep jailmount
data/jail-mounts/zfsmount on /zroot/iocage/jails/zfsmount/root/jailmount (zfs, local, nfsv4acls)
data/jail-mounts/zfsmount/PG on /zroot/iocage/jails/zfsmount/root/jailmount/PG (zfs, local, nfsv4acls)
root@zfsmount:~ # ls /jailmount/
foo PG
root@zfsmount:~ # zfs unmount data/jail-mounts/zfsmount/PG
cannot unmount '/zroot/iocage/jails/zfsmount/root/jailmount/PG': Operation not permitted
root@zfsmount:~ #
root@zfsmount:~ # zfs unmount data/jail-mounts/zfsmount
cannot unmount '/zroot/iocage/jails/zfsmount/root/jailmount/PG': Operation not permitted
root@zfsmount:~ #
root@zfsmount:~ # umount /jailmount
umount: unmount of /zroot/iocage/jails/zfsmount/root/jailmount failed: Operation not permitted
root@zfsmount:~ # umount /jailmount/PG
umount: unmount of /zroot/iocage/jails/zfsmount/root/jailmount/PG failed: Operation not permitted
I'm totally not sure what I'm doing wrong here or if this is just some weird zfs/jail bug.