You are not logged in.

#1 2011-04-08 03:16:11

Buce
Member
From: Duluth, Minnesota, US
Registered: 2009-03-17
Posts: 23

Samba or NFS?

I'm not sure if this should go in this forum or another, or if it would be better to ask in a non-Arch-centric place altogether, but I've always been impressed by the technical knowledge of the Arch community, so I thought I'd try here first.

I want to share some directories across my home network, and I want to know whether it would be better to use Samba or NFSv4. This will be set up on a 1TB, LUKS-encrypted, software RAID1 array, with LVM. I've scoured the net, reading comparisons of the two, and haven't found any info that makes it obvious for me to use one or the other, given my situation. Seems like most people choose one over the other either because it's easier to configure or because they use Windows (I don't).

My requirements, in order of importance:
* Allow for multiple clients to access the same share without complications (file locking issues, data corruption, race conditions, what-have-you)
* Allow for certain system directories (see below) to be shared -- not sure if there's any special considerations here not covered by the previous bullet point, or what security considerations there are for files that need to be accessed by root, httpd, etc.
* Can be configured to encrypt data passed over the network
* Can be configured to require authentication before mounting EDIT: but without me having to type a password

The directories I plan on sharing:
* /home, I'd like to share between multiple clients
* /srv/*, which has my mpd library, some videos, and some html/php pages. I won't be sharing any of that data between multiple machines.
* /data/*, which is a bunch of directories that hold mpd, mysql, and postfix-virtual-mailbox data. What I'm most concerned about here is mysql -- my /data/mysql is the db files normally located at /var/lib/mysql. I have a database for the wiki on my webserver and I'm in the middle of setting another up for some postfix info for my mail server. Can I just share the data on both machines and have each mysqld daemon access it normally, or would I be better off setting up a single engine on one machine and having the other access it externally? My limited database experience says to go the second route, but I'd like confirmation on this.
* maybe /usr/local, which is mostly if not all plain text scripts and such right now, but could potentially have compiled binaries in the future. I'm guessing I'm not gonna get away with sharing this between multiple clients.

Last edited by Buce (2011-04-08 03:21:18)

Offline

#2 2011-04-08 04:21:24

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: Samba or NFS?

As for Samba, if a speed does bother your, I have shared own experience here: https://bbs.archlinux.org/viewtopic.php?id=115788 I still frustrated with file managers we all use..

As for selection between NFS and Samba, to my taste this aspect must be taken into consideration: what happens with client at, say, network drop? Probably I'm wrong, but with Samba there is less needing to find and kill -9 all clients smile


"I exist" is the best myth I know..

Offline

#3 2011-04-08 06:57:30

Damnshock
Member
From: Barcelona
Registered: 2006-09-13
Posts: 414

Re: Samba or NFS?

student975 wrote:

what happens with client at, say, network drop? Probably I'm wrong, but with Samba there is less needing to find and kill -9 all clients smile

Autofs takes care of that


My blog: blog.marcdeop.com
Jabber ID: damnshock@jabber.org

Offline

#4 2011-04-08 07:13:55

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: Samba or NFS?

Damnshock wrote:

Autofs takes care of that

Yes, I use autofs for cifs mounting. Are you using autofs with NFS? Is it as "relaxed" as cifs+autofs (I mean client hanging)?


"I exist" is the best myth I know..

Offline

#5 2011-04-08 07:52:51

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: Samba or NFS?

I make a simple discission,  in a network with windows -> samba else NFS

Configuring NFS is easy and samba setups can be a pain in the ass wink

Offline

#6 2011-04-08 11:45:29

Damnshock
Member
From: Barcelona
Registered: 2006-09-13
Posts: 414

Re: Samba or NFS?

@jelly

I agree

#student975

Well, I've had no problem with autofs+nfs so far


My blog: blog.marcdeop.com
Jabber ID: damnshock@jabber.org

Offline

#7 2011-04-08 13:27:17

ChojinDSL
Member
From: Germany
Registered: 2010-11-30
Posts: 64
Website

Re: Samba or NFS?

If you want speed, go with nfs (need for speed? ;-) )

Samba has way too much overhead for my taste.

Offline

#8 2011-04-08 13:45:57

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: Samba or NFS?

ChojinDSL wrote:

If you want speed, go with nfs...

Have you measured NFS speed in gigabit LAN? How?

There are plenty confirmations like "NFS is faster rather CIFS" and vice-versa. But I never saw real measurements description. I have described my experiments with CIFS in above reffered thread. Have you something similar with NFS? smile I'm indeed interested in.

Last edited by student975 (2011-04-08 13:57:50)


"I exist" is the best myth I know..

Offline

#9 2011-04-08 14:08:24

Buce
Member
From: Duluth, Minnesota, US
Registered: 2009-03-17
Posts: 23

Re: Samba or NFS?

jelly wrote:

I make a simple discission,  in a network with windows -> samba else NFS

Configuring NFS is easy and samba setups can be a pain in the ass wink

Could you elaborate? I've seen a lot of people say they think that either samba or nfs is easier to configure, but without providing details as to why. Seems to be mostly a matter of personal taste.

Offline

#10 2011-04-08 14:16:43

Buce
Member
From: Duluth, Minnesota, US
Registered: 2009-03-17
Posts: 23

Re: Samba or NFS?

Granted it's only been half a day, but no one's really addressing the requirements I outlined in my OP. Can I take this to mean that I can accomplish what I want with either protocol?

Has anyone had issues mounting, say, /home with multiple computers and accessing data concurrently?

Has anyone used encryption or passwordless authentication? What options are there for doing this?

Are there any technical issues or security concerns with sharing system files that need to be read/written by root or system daemons?

Offline

#11 2011-04-08 15:01:43

ChojinDSL
Member
From: Germany
Registered: 2010-11-30
Posts: 64
Website

Re: Samba or NFS?

student975 wrote:
ChojinDSL wrote:

If you want speed, go with nfs...

Have you measured NFS speed in gigabit LAN? How?

There are plenty confirmations like "NFS is faster rather CIFS" and vice-versa. But I never saw real measurements description. I have described my experiments with CIFS in above reffered thread. Have you something similar with NFS? smile I'm indeed interested in.

Way back when, I had two Windows PCs which I connected directly via crossover cable. This was back in my windows XP days. Anyways, I was always puzzled as to why I never managed to get a transfer rate above 50%-75%. 75% tops.
Granted, this was still "only" 100mbit. But, this wasn't isolated to just my pc. I reproduced the same effect on a friends machine. Same result with the speed.

It wasn't until I started using linux that I realized that close to 100% network transfer speed is actually possible.

I have both on my server setup at home. I'll try that out and post the results.

Offline

#12 2011-04-08 15:27:11

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: Samba or NFS?

ChojinDSL wrote:

I have both on my server setup at home. I'll try that out and post the results.

Yes! It would be very valuable! Especially if you will try different nfs-mounted clients - dd, file managers - as I have tried with cifs (where smbclient got all gigabit rate, while dd and file managers are not equally fast).


@Buce

Probably most real use cases are trivial wrt access rights and, as a result, not interesting for you (with such complicated demands). At my case there are two types of samba shares - 1). rw for the only user, 2). for two users with ro and rw for the first one and the second; all shared folders are beyond standard filesystem (/home, /usr and so on).


"I exist" is the best myth I know..

Offline

#13 2011-04-08 20:05:51

Buce
Member
From: Duluth, Minnesota, US
Registered: 2009-03-17
Posts: 23

Re: Samba or NFS?

student975 wrote:

Probably most real use cases are trivial wrt access rights and, as a result, not interesting for you (with such complicated demands). At my case there are two types of samba shares - 1). rw for the only user, 2). for two users with ro and rw for the first one and the second; all shared folders are beyond standard filesystem (/home, /usr and so on).

Fair enough, guess I'll just dive in and see how things go. Thanks for the input, everyone!

Offline

#14 2011-04-09 15:53:19

TheCox
Member
From: Orlando, FL
Registered: 2010-02-23
Posts: 34

Re: Samba or NFS?

Buce wrote:

Granted it's only been half a day, but no one's really addressing the requirements I outlined in my OP. Can I take this to mean that I can accomplish what I want with either protocol?

Has anyone had issues mounting, say, /home with multiple computers and accessing data concurrently?

Has anyone used encryption or passwordless authentication? What options are there for doing this?

Are there any technical issues or security concerns with sharing system files that need to be read/written by root or system daemons?

You can do what you want with either protocol. IMO authentication is easier to configure in Samba, but otherwise NFS is the better option. It has lower overhead since it is designed strictly for sharing directories between unix servers, whereas Samba's purpose is full featured interoperability with Windows.

Offline

Board footer

Powered by FluxBB