Riaan's SysAdmin Blog

My tips, howtos, gotchas, snippets and stuff. Use at your own risk!

Uncategorized

ZFS on Linux SMB Sharing

Having worked on and liked ZFS for a long time I am now using ZFS on my main Linux desktop. I thought it would be nice if I can just turn on SMB sharing using ZFS but after playing with this for a while I gave up. Seems like one person on the Internet said it best just let ZFS take care of the file-system and let Samba take care of SMB sharing. I came to the same conclusion. I am recording some of my notes and commands for my reference maybe someone else find it useful.

Un-mount the old ext4 partition and create a pool. Of course don't create a pool on a disk you have DATA on!

# umount /DATA 
# fdisk -l | grep sd
# zpool create -m /DATA DATA /dev/sdb1
# zpool create -f -m /DATA DATA /dev/sdb1

Turn sharing on the ZFS way.

# apt install samba
# zfs set sharesmb=on DATA
# pdbedit -a rrosso

I get parameter is incorrect from a Windows client. Gave up on this and shared using smb.conf.

# zfs set sharesmb=off DATA
# zfs get sharesmb DATA
NAME  PROPERTY  VALUE     SOURCE
DATA  sharesmb  off       local

# tail -10 /etc/samba/smb.conf 
[DATA]
path = /DATA
public = yes
writable = yes
create mask = 0775
directory mask = 0775

# systemctl restart smbd
# net usershare list

# testparm 
{..}
[DATA]
	create mask = 0775
	directory mask = 0775
	guest ok = Yes
	path = /DATA
	read only = No

Note some commands and locations for troubleshooting.

# smbstatus 
# testparm
# cat /etc/dfs/sharetab 
# net usershare list
# ls /var/lib/samba/usershares/
# cat /var/lib/samba/usershares/data 
# pdbedit -L

admin

Bio Info for Riaan