Samba Server vs. NFS Server

Article by Berry van der Linden (2,680 pts ) , published Nov 4, 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

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