Skip to content

Zfs on linux smb sharing

wordpress meta

title: 'ZFS on Linux SMB Sharing'
date: '2019-03-05T18:47:21-06:00'
status: publish
permalink: /zfs-on-linux-smb-sharing
author: admin
excerpt: ''
type: post
id: 1316
    - Uncategorized
tag: []
post_format: []

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
</div>Turn sharing on the ZFS way.

<div class="wp-block-syntaxhighlighter-code ">```

# 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
</div>Note some commands and locations for troubleshooting.

<div class="wp-block-syntaxhighlighter-code ">```

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