Skip to content

Instantly share code, notes, and snippets.

@raspi
Last active March 12, 2021 16:24
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save raspi/9986175 to your computer and use it in GitHub Desktop.
Save raspi/9986175 to your computer and use it in GitHub Desktop.
FreeBSD ZFS Samba 4 config with recycle and read/write optimizations example
# Samba 4 config example
# Connected to existing remote Samba 4 Active Directory Directory Controller
# ZFS pool @ /storage
# Network is 192.168.101.0/24
# Samba is installed with:
# pkg install samba42
# and then joined to existing AD with:
# samba-tool domain join <params>
# After this /usr/local/etc/smb4.conf is edited and restarted with /usr/local/etc/rc.d/samba_server restart
# Global parameters
[global]
server string = Samba Server
hosts allow = 192.168.101. 127.0.0.1
load printers = no
max log size = 50
# Add aio_load="YES" FreeBSD's /etc/rc.conf
aio read size = 16384
aio write size = 16384
aio write behind = true
use sendfile = true
read raw = true
min receivefile size = 16384
interfaces = 192.168.101.0/24
dns proxy = no
# These files are never saved
veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/
delete veto files = yes
workgroup = HOME
realm = home.lan
netbios name = STORAGE
server role = active directory domain controller
[netlogon]
path = /var/db/samba4/sysvol/home.lan/scripts
read only = No
[sysvol]
path = /var/db/samba4/sysvol
read only = No
# ZFS pool
[storage]
path = /storage
force directory mode = 0666
force create mode = 0666
create mask = 0666
directory mask = 0666
read only = no
public = no
writable = yes
vfs objects = zfsacl
nfs4:mode = special
nfs4:acedup = merge
nfs4:chown = yes
vfs object = recycle
# Remove deleted files to recycle bin directory with username and timestamp
recycle:repository = /storage/recyclebin/%U/%T
recycle:keeptree = Yes
recycle:touch = Yes
recycle:versions = Yes
recycle:directory_mode = 0666
recycle:subdir_mode = 0666
nt acl support = yes
inherit acls = no
map acl inherit = yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment