Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NFS or Samba?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ckdake
l33t
l33t


Joined: 10 Apr 2003
Posts: 889
Location: Atlanta, GA

PostPosted: Tue Oct 26, 2004 1:06 pm    Post subject: NFS or Samba? Reply with quote

I'm doing some research for both self interest and to come up with a set of criteria for some things at work. Basically, I know that Samba nd NFS both do different thigns and each have their pros and con's but heres what I have so far and I'm just wondering if I've left anything significant out. Once this is all said and done I will be making a HOWTO for deciding which one to use.

NFS

    -come with most unix/linux by default
    -must be installed on windows using third party tools
    -protocol designed for only file sharing
    -well designed and documented yet supposedly difficult to configure
    -unix permissions
    -support for larger file sizes (2GB+)
    -no required time synchronization
    -locking issue: nfs is stateless so if A and B are connected to server C, A is working on a file and crashes during a write, the file will remain locked until either A or C is restarted. If C crashes while clients have a lock, all locks are lost and B could get a lock on the file while A thinks it has the lock, next time A tries to do something there could be problems (not a problem for a stable environment where files are only accessed by one user at a time or at all)
    -“Regardless of the system specifics, programs often assume that if they are unable to obtain a lock, it is because another program has the lock. This can cause problems as programs wait for the lock to be freed. Since the reason the lock fails is because locking is unsupported, the attempt to obtain a lock will never work. This results in either the applications waiting forever, or aborting their operation.”
    -“A file creation will sometimes return success even if the file already exists. Programs written to work on a local file system will experience strange results when they attempt to update a file after using file creation to lock it, only to discover another file is modifying it (I have personally seen mailboxes with hundreds of mail messages corrupted because of this), because it also "locked" the file via the same mechanism.”
    -has delayed write caching on the client side
    -accesstime on the filesystem may not reflect most recent NFS access
    -files aren’t opened and closed the same way as unix so a file can be opened, nfs stores it as a .nfsXXXXX file, which then cannot be deleted if the process using it crashes
    -user/group id numbers used so mapping must be the same on all machines.
    -all data transmitted in the clear
    -processes cannot be killed because they are waiting on the “fast IO” of the nfs server if it crashes because nfs is treated as a disk
    -uses client for authentication
    -"NFS uses an explicit resource browser capability. This means that an NFS client can poll a particular server using the showmount program, as in showmount -e fileserver, to see what directories have been exported. "


Samba

    -installed on windows by default
    -must be installed on linux
    -protocol designed to handle all sorts of things
    -ad-hoc and perhaps less well documented, but easy to install and configure
    -can authenticate against a windows domain
    -windows permissions
    -locking issue with windows clients: use “sendfile = no” solves it
    -uses server for authentication
    -samba clients can see what servers are available on the network, not just shares on a specific server


Resources
http://www.time-travellers.org/shane/papers/NFS_considered_harmful.html
http://www.linuxplanet.com/linuxplanet/tutorials/2684/1/
_________________
http://ckdake.com/
Back to top
View user's profile Send private message
Cosmin
Guru
Guru


Joined: 18 Dec 2003
Posts: 447
Location: Bucharest, Romania

PostPosted: Tue Oct 26, 2004 3:15 pm    Post subject: Reply with quote

It depends what you want to do. If you are in a linux only network, I'd suggest NFS. It's easy to setup. Also, it's easy not to export as RW the directories that cause problems. mail is just an example, there are many others.
On the other hand, if you are in a mixed environment (win+lin) than you should go for samba.
So, your decision should not be based on pros/cons, but on your environment.

My 0.02$...
_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan
Back to top
View user's profile Send private message
ckdake
l33t
l33t


Joined: 10 Apr 2003
Posts: 889
Location: Atlanta, GA

PostPosted: Tue Oct 26, 2004 4:10 pm    Post subject: Reply with quote

I definitely agree with that. I'm hoping to use the pro/cons of each to provide an easy way to evaluate which one will be better for any given application environment combination.
_________________
http://ckdake.com/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum