Samba4, ZFS on Linux and Mac OS X clients
After quite a bit of testing last year, I got Samba 3.6.x to play pretty nicely with Mac OS X clients. Pretty nicely in this context means that the logon and permissions worked as needed, the performance was decent and office programs and adobe programs worked with files on the share.
After reading about some new things coming to samba4 (thank you Ralph for your comments on the macenterprise email list), especially in terms of support for Mac clients, I decided that some upgrades were needed.
I have used Debian as my primary Linux platform for some time now. The tools provided by the repositories are solid, and I can always build my own when I need something more cutting edge. In this case, I have been using debian stable 7.7.
ZFS on Linux has been rock solid for me, and provided many incredibly useful tools (autosnapshot, zfs send/receive, growing a FS by replacing drives with bigger disks etc.). I use the one I get from the zfsonlinux repositories for debian. At the time of writing, I am using the following:
The version samba4 I am using for the setup below is samba 4.2.0 rc2, together with a specific patch extracted from https://github.com/slowfranklin/samba/commits/aapl to enable the vfs_fruit functionality.
The samba team recentely released samba 4.2. RC3, which has all the vfs_fruit and aapl extensions built in.
After a lot of testing I have managed to come up with the following setup which seems to do all the stuff I want it to:
- works with acls on the FS level, so I can manage acls using setfacl and getfacl
- phenomenal speed for a smb share
- file locking is consistent
- permissions of files created and copied to the share are the same
- The server will also function as a full AD DC, and all that entails (LDAP, DNS, Kerberos etc.)
There is still some wonkiness with this setup:
- Deleting files without the vfs_recyle option will not work, the files are not actually deleted before the client doing the deleting quits the share (this needs some more detective work, for now the workaround is ok)
- Spotlight will not work with this setup
- A separate cron script will be needed to clean up the recyclebin, when it starts to fill up
There are some settings on the ZFS side I found helpful:
The zfs support for posixacls seems solid, and makes managing the acls a breeze.
There is an option of storing the xattrs with the inodes, instead of a seprate tree (http://www.nerdblog.com/2013/10/zfs-xattr-tuning-on-linux.html). I just have no idea how this would effect the vfs_fruit extension above or the Adobe programs that use xattrs to store all kinds of stuff, and might result in very big xattrs. Much more lab work is required to sort this out…
There must a ton of things I could do better, and I will appreciate any and all feedback. Testing something like this just tends to be very time consuming, as there are so many moving parts. I just hope this post helps other macadmins to test the open source samba. Special thanks to Ralph Böhme from SerNet for his pointers and patches.