Ubuntu ZFS Samba share

In my previous posts regarding setting up ZFS on Ubuntu 16.04, I had referred to Aaron Toponce’s website on doing additional configuration to ZFS such as sharing via NFS or SMB.

In the portion for SMB here: https://pthree.org/2012/12/31/zfs-administration-part-xv-iscsi-nfs-and-samba/, it seems that there is a couple more things to do.

After running zfs set sharesmb=on pool/srv  and zfs share pool/srv, the share will be visible on the network from a Windows computer. However, if you try to access it, you will be prompted by an user authentication prompt. If you try to access as guest, access will be denied.

When running the zfs share command, a file will get created in /var/lib/samba/usershares/[zpool name]

In the file, you will need to look for “guest_ok=n” and change it to: “guest_ok=y

example:

#VERSION 2
path=/opt/share
comment=Comment: /opt/share
usershare_acl=S-1-1-0:F
guest_ok=y
sharename=tank_export

And finally, to make the directory read/writable: sudo chmod 0777 [path to your ZFS filesystem]

3 thoughts on “Ubuntu ZFS Samba share”

  1. is it possible to use a sharename with spaces like “sharename=tank export”?
    I can’t get it to work

  2. Very cool. I just set up a share myself with ZFS and it worked. I still don’t see the benefit over not configuring this yourself; it actually seems like an added step, so kinda useless, unless there’s a deeper motive I’m not thinking of.

    It’d be easy to tell, I suppose, from the properties for any scripters if this path was being shared without parsing a samba configuration file.

Comments are closed.