ZFS Mount zfs dataset in iocage jail

I can't figure out how to mount an additional ZFS dataset inside an iocage jail.

I've created the dataset on the host and did zfs jail (jid) (pool/dataset).

The dataset shows up with zfs list inside the jail but zfs mount (pool/dataset) as root returns cannot mount: ... permission denied. The dataset is not mounted outside the jail and /dev/zfs exists inside the jail with root : operator.
 
  • Thanks
Reactions: Oko
No idea how to set iocage for it but jails require allow.mount.zfs and allow.mount to be set for this to work. See jail(8):
Code:
             allow.mount.zfs
                     privileged users inside the jail will be able to mount
                     and unmount the ZFS file system.  This permission is
                     effective only together with allow.mount and only when
                     enforce_statfs is set to a value lower than 2.  See
                     zfs(8) for information on how to configure the ZFS
                     filesystem to operate from within a jail.
 
  • Thanks
Reactions: cfw
You are absolutely right about allow.mount.zfs and allow.mount.

Running iocage set jail_zfs=on jailtag and iocage set jail_zfs_dataset=datasetName will set allow.mount.zfs=1, allow.mount=1 and enforce_statfs=1 for that particular jailtag or uuid.

Unfortunately I have two zpools and iocage does not accept a pool name, instead defaulting to the pool the jail resides on.

Anyhow, thanks for the help.
 
  • Thanks
Reactions: Oko
Back
Top