Samba Server vs. NFS Server

Article by Berry van der Linden (2,680 pts )
Edited & published by Michele McDonough (82,912 pts ) on Nov 9, 2009

When sharing files, just like with anything on Linux, you have more then one option, and you should make your choice based on what you need. We'll take a look at both SAMBA Server and NFS Server in this article.

Samba vs. NFS

First of all, what are the main features of the two?

Samba Server

  • Windows can connect to it natively without installing third-party software.
  • Assists in network browsing. With or without NetBIOS.
  • Acts as a Windows NT®-style Primary Domain Controller (PDC).
  • Acts as a Backup Domain Controller (BDC) for a Samba-based PDC.
  • Acts as an Active Directory domain member server.
  • Joins a Windows NT/2000/2003 PDC.

NFS Server

  • Faster then Samba when transferring large files over the network.
  • Easy to setup on any Linux system.
  • Supports Kerberos for authentication.
  • Has the ability to squash root so clients accessing the shares cannot access root files.
  • Uses IP-addresses to authenticate the client. And, is thus easier to setup.

Which One Should I Pick?

Run Any Windows?

If you have some Windows boxes in the network, then it might be better to choose Samba/CIFS. Natively, Windows doesn't support NFS. You would have to get a third party client application to be able to access your NFS shares.

If You're Purely Linux:

However, if your network consists of Linux boxes only, then NFS is the choice you could make. The simple setup will allow you to authenticate clients by IP address. This is secure on smaller networks like at home or small businesses, but you should setup with Kerberos when you have a substantial network of 25 boxes or more. It will provide you with better authentication. This setup will be harder if you have 25 boxes or more, so you may want to get a Linux guru do this for you.

I recently upgraded my Samba client to CIFS. This will have a better integration for your Linux file systems. It's also easier to get the permission rights using CIFS over Samba clients. I find that CIFS is faster than the Samba client.

Transfer speed of files over 1GB are faster on the NFS server. I have Samba and NFS installed on my file server and can access Linux and Windows boxes. NFS is faster than Samba and CIFS clients.

Conclusion

If you run a small network with only a few boxes, then use NFS server but don't forget to use “root squash” to make sure you don't give anybody root access to directories on the file server.

If you have a larger network and you administer user accounts on the server, then NFS with Kerberos is probably a better choice.

If you have Windows-based boxes that need to access the file server, you could always purchase third-party software. As far as I know, there are no free NFS clients under Windows. So, you can opt for Samba server instead.

Comments

Nov 15, 2009 8:49 PM
chuck
windows 7
I've been told that windows 7 includes the ability to connect to NFS shares. have not tried it however.
Nov 10, 2009 8:22 PM
Frank Kalf
NFS and Samba together
Yes U can.
As long it is a Linux server, then it is configured in a jiffy, the latter one requires more config and the client Aaron mentioned.
Nov 9, 2009 10:58 AM
chswin
Fud
This article is such FUD.... The performance on NFS in Windows Server 2008 x64 and 2008 R2 x64 is on par if not better than NFS on CentOS. As far as the weekly reboots mentioned by @Aaron; this has not been the case in our environment (check your config). Windows support for NFS is not third party and hasent been for nearly 8 years. And as far as comparison of Protocols SMB 2.0 performance is on par with NFS 3.0 and the elusive NFS 4.0. There is a performance readout on SPEC of NFS on Windows 2003 R2 with excellent performance numbers. These statements by Berry are unfounded and stem from opinion rather than fact or experience.

Point: Both platforms for serving NFS or CIFS are relatively the same, if researched and configured accordingly....
Oct 10, 2009 7:07 PM
Tiao
Windows NFS
@Aaron

This NFS server of Windows is crap. It needs a weakly reboot, and the permissioning(user/group) it's a joke. We tried to use on our work, just because the Windows sysadmins have one created, to not dispend more time creating a NFS server. The result: We downloaded the CentOS and maked a real NFS server....
Oct 2, 2009 6:09 PM
Frank Kalf
NFS & Samba
@Jorge : Yes, one can have both systems running at the same time, my Ubuntu 8.04 server runs them.
I use Samba in my WinXP VBox and NFS in Ubuntu 9.04 on JFS and EXT3 filesystems.
In my experience one should avoid doing mass file operation with the Samba FS.
Jul 7, 2009 9:19 PM
Jorge
NFS and SAMBA on the same server
first of all thank you for the article. it's an important discussion. I would like to know if I can configure SAMBA and NFS on the same server and how to make a Mac access those files. I have several windows boxes, 1 mac and 1 linux box (ubuntu). thank you. best regards
Jul 2, 2009 9:09 AM
Aaron Low
Windows Free NFS Client
Just to let you know, there is a free Windows NFS client available from Microsoft. It is part of the Unix Services for Windows package. It is available at the following link: http://www.microsoft.com/Downloads/details.aspx?familyid=896C9688-601B-44F1-81A4-02878FF11778&displaylang=en

Aaron