NFS/SMB share of ZFS-Pool

MisterY

Renowned Member
Oct 10, 2016
140
4
83
38
Hi,

I would like to share my ZFS-Pool "tank" (not the boot-pool) with my VMs and LXC with NFS or Samba. I tried it with NFS and Samba itself, but it didn't work because of some permisison problems (user and group and permissions were set correctly; with a Win-Guest it is working, but not with Linux...)

I read that zfs has some features about sharing the pool with NFS.
I took this guide here: https://docs.oracle.com/cd/E23824_01/html/821-1448/gayne.html

and I tested it with:

sudo zfs set share=ZFS,path=/tank/nfs,prot=nfs tank/nfs
cannot open 'tank/nfs': dataset does not exist
user@pve:~$ sudo zfs set share=ZFS,path=/tank/nfs,prot=nfs tank
cannot set property for 'tank': invalid property 'share'
user@pve:~$ sudo zfs set share=ZFS,path=/tank/nfs,prot=nfs /tank
cannot open '/tank': invalid dataset name

sudo zfs set sharenfs=on /tank/nfs
cannot open '/tank/nfs': invalid dataset name
what am I doing wrong?

I set before this a NFS and Sambashare without "zfs set" and both can be seen by clients, but not mounted or written on it..

edit: this worked:
sudo zfs set sharesmb=on tank

but: Linux-Guests are not allowed to write on it. Why?
 
Last edited:
Hello misterY,

did you check the aclmode?
I had some issues like you on freenas aswell.

Set from zfs aclmode=restricted to passthrough and see if this helps.

Best regards
 
still no writing-permissions :(

I read somewhere about if you set mp0 SIZE=0 it will be mounted as directory. Maybe will this solving the problems for the LXC? I would like to test it, but I can't set 0GB in the webgui..

edit: in the lxc.conf it is setable. This works now like a charm :) but only for LXC. In VMs this sadly doesn't work
 
Last edited: