# Advices for creating a samba configuration over zfs



## digrouz (Dec 1, 2011)

Hello,

I'm building a NAS at home running FreeBSD 9.0-RC2. As I'm not a samba expert and a noob to zfs :r I would like to get some advices about how to get a good configuration.

Do it need specific options in smb.conf?

Can anonyone post a sample configuration with small descriptions?


----------



## SirDice (Dec 1, 2011)

digrouz said:
			
		

> Do it need specific options in smb.conf?


No.



> Can anonyone post a sample configuration with small descriptions?


There's a lot of documentation on the samba website. Including configuration examples and explanations.

http://www.samba.org/samba/docs/


----------



## peetaur (Dec 10, 2011)

You probably don't need any samba advice.

But the best advice, is make sure you have a backup. There are lots of stories of people out there desperately trying to recover broken pools because of an admin error, software upgrades gone wrong, or bad hardware. RAID doesn't save you from these things. RAID only saves you from a single or sometimes multiple disk failure.

And the second best advice to a new zfs admin is: before you do anything creative/stupid, try it in a virtual machine first.


----------



## vermaden (Dec 10, 2011)

digrouz said:
			
		

> Do it need specific options in smb.conf?
> 
> Can anonyone post a sample configuration with small descriptions?



I use these in smb.conf for better transfer rates.

```
[global]
  aio read size    = 16384
  aio write size   = 16384
  aio write behind = true
  socket options   = SO_KEEPALIVE TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384
```


----------



## digrouz (Dec 30, 2011)

I've those messages in the logs, how can I fix that?



```
Dec 30 16:17:51 xxxx smbd[2410]: [2011/12/30 16:17:51.817442,  0] param/loadparm.c:8004(lp_do_parameter)
Dec 30 16:17:51 xxxx smbd[2410]:   Global parameter unix extensions found in service section!
Dec 30 16:17:55 xxxx smbd[2410]: [2011/12/30 16:17:55.545685,  0] modules/vfs_posixacl.c:170(smb_ace_to_internal)
Dec 30 16:17:55 xxxx smbd[2410]:   unknown tag type 64
```


----------



## mnvn (Dec 30, 2012)

One year after, but here it is 

You should add to your config:

```
[global]
    unix extensions = no
    nt acl support  = yes
    inherit acls    = no
    map acl inherit = yes

[share]
    vfs objects     = zfsacl
    nfs4:mode       = special
    nfs4:acedup     = merge
    nfs4:chown      = yes
```

That's because ZFS operates on extended ACL's (like NFSv4 and Windows), which is verrry nice feature . Read more at https://blogs.oracle.com/marks/entry/zfs_acls


I've also noticed, that options from [share] can be put in [global] - usefull if we've got ZFS everywhere, no space wasting in share definitions.


----------

