# NFS vs Samba on ZFS?



## wonslung (Jun 18, 2009)

Hello, i just got my server up and running, i have 3 raidz vdevs 4 1tb sata drives each and 1 80 gb ZIL disk.  (i'll likely add 2 more vdevs and a ssd for l2arc at some point) I'm interested in networking it.  I use this as a media server, i switched to freebsd because of ZFS, my old system was linux 2.6.16, mdadm raid5 with an XFS filesystem and samba.  Most of my machines are linux based so i shouldn't have an issue with NFS, but i've never tried it.  I was wondering what peoples opinions were on the issue.  I have mostly movies and tv shows but i also plan to use it for remote home directories MAYBE, if it's worth doing.

Any answers or ideas would be great, sorry if this is a flamewar post, as this is NOT my intention.

Thanks


----------



## phoenix (Jun 18, 2009)

I've used both (samba and nfs to share zfs and ufs), but haven't noticed anything too different between them.

Personally, I prefer CIFS over NFSv3, as permissions and ownership are done via username and not just UID number.

With NFSv3, everything is done via UID number, which means you have to keep your username <-> UID in sync between all the different systems (ie keep /etc/passwd in sync) or else you have to configure, setup, and use a global user database like NIS.

You don't have to do that with Samba/CIFS.

NFSv4 supports a lot of the same ownership/permissions/ACL stuff that Samba does, but I've never used it.

In theory, NFS should be faster/easier as it's native to Unix.  But, in practise, I've found Samba/CIFS to be nicer/easier/"more secure".

The nice thing about ZFS is that you get NFS exporting "for free".  You enable NFS server stuff in /etc/rc.conf, then set the *sharenfs* property using the exact same syntax as you would for /etc/exports.

However, you can share out a ZFS filesystem just as easily as a normal UFS filesystem, via Samba.

So, really, it comes down to:  which do you know better?  NFS or Samba.


----------



## wonslung (Jun 18, 2009)

yah, i saw the sharenfs option...also see sharesmb and shareiscsi

i guess i'll probably try both and see which one is better for me.

I've used samba for awhile...so i know the config file at least.


----------



## phoenix (Jun 19, 2009)

*sharecifs* or whatever it's called, doesn't do anything on FreeBSD.  It's an unchangeable property.  You just configure Samba as per normal.

*shareiscsi* also doesn't do anything on FreeBSD, as there is no iSCSI target daemon available in the base OS.  However, you can install one of the iSCSI target ports, and configure those as per normal, using ZFS zvols instead of ZFS filesystems.


----------



## shitson (Nov 22, 2010)

phoenix said:
			
		

> *sharecifs* or whatever it's called, doesn't do anything on FreeBSD.  It's an unchangeable property.  You just configure Samba as per normal.



Hopefully a supported feature one day, but this backs up my suspicions. Thanks for the information!


----------

