Samba or NFS?

Status
Not open for further replies.

o2893666

Cadet
Joined
Oct 31, 2012
Messages
2
Good day,

Good to see FreeNAS 8.3 is out and having installed it I'm wondering whether to install samba or NFS. Samba is for windows networks but in hour home we only have Linux Mint PC's and our mobiles and tablet are Android based.

NFS seems to be more difficult to set up than Samba, but since we only have Linux (Android) computers should I then not set up NFS?

Your advice and suggestions are very welcome.

Many thanks,
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I stuck with Samba only because if you have any company over they'll almost certainly be Windows machines. I also found that the differences between NFS and CIFS were somewhat trivial. If you are in a situation where you want NFS, you'll KNOW you WANT it.
 

o2893666

Cadet
Joined
Oct 31, 2012
Messages
2
Thanks for the advice noobsauce80.

BTW, should you not change your username? Judging from your Guide and knowledgeable answers, you're not a noob at all ;-)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Actually, I'm still a noob in some ways. While I'm good at fixing alot of common issues FreeNAS has, there's alot of stuff that's "over my head". I really wasn't expecting to turn into a regular guy on the forums. I'm not sure I can even change my name.
 

Yell

Explorer
Joined
Oct 24, 2012
Messages
74
My nas box i only service files at linux (windows/tv's go with minidlna plugin) but i'm forced to use ssh/smb for file transfer.

The only reason not to use NFS is that it cant cross filesystems boundries (mean you cant access a child dataset from the current pool)
 

leenux_tux

Patron
Joined
Sep 3, 2011
Messages
238
Samba or NFS

o2893666,

You can also share folders using both CIFS and NFS as the same time. I do this for three of my shares, movies, music and ISO images. That way, my Linux based systems (Fedora Core with MythTv, Linux Mint with XBMC and a VMWare ESXi5 system) and my Windows boxes can access the shares. Works pretty well once you get the permissions and stuff sorted
 

mattlach

Patron
Joined
Oct 14, 2012
Messages
280
SMB/CFS and NFS each have their own advantages and drawbacks.

I don't claim to be an expert on either.

I have yet to set up either in FreeNAS, but I set up SAMBA manually by editing smb.conf on my previous Ubuntu storage server.

SMB/CIFS Benefits:
- Native Windows Support
- Security (at least percieved) better on open networks

NFS Benefits:
- Can achieve higher transfer speeds
- Typically uses a lot less server CPU power
- Can take advantage of multiple CPU cores per instance.
- Native support for Unix like systems (BSD/Linux/Android/OS X)

If your network is closed (firewalled, you know and trust all clients on it) NFS will typically be the best solution for performance.

It's packet transfers are more efficient, so there is less overhead on the network, it uses less CPU load and when it does is multithreaded so it can spread this load over multiple cores. This can all result in higher transfer speeds. It can be a pain to have to install NFS on visitors computers though, as most people have Windows machines.

I don't know the details in security differences between NFS and SMB, but its often suggested that SMB is a better choice for security (which is funny cause it originates from Microsoft :p ) This may just be a perception and not reality though, not sure.

SAMBA is single threaded, and the project has clearly stated it will remain that way. Due to the way it works it simply would not benefit from multithreading. It uses one thread per connection, and as such if your server does not have a fast CPU, can wind up slowing down your max per/connection transfer speed. However, each connection gets its own CPU thread, so over multiple connections, the theoretical max speed will be similar to NFS from a CPU perspective.

NFS - I understand - also has lower network overhead, and as such should be able to get closer to the 128MB/s max theoretical transfer speed possible over a gigabit Ethernet connection than SAMBA, if CPU and drive speed is fast enough to allow Ethernet to be the limiting factor.

My plan is to set up all my clients via NFS, but also have a SAMBA guest access set up for visitors.

Hope this helps,
Matt
 

captain118

Dabbler
Joined
Oct 1, 2014
Messages
21
Did you configure the Volume for UNIX permissions or Windows/MAC permissions?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Ah the joys of necromancy. It might be a good idea to actually start a new thread rather than replying to one that died two years ago. But thanks, now I know that Cyberjock used to be "noobsauce80". :)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Ah the joys of necromancy. It might be a good idea to actually start a new thread rather than replying to one that died two years ago. But thanks, now I know that Cyberjock used to be "noobsauce80". :)

Wow, funny (literally!) what a random necro'd thread reveals. We need one of those animated smileys that laugh their asses off in here!

This only serves to further prove that Cyberjock has been painfully honest from the start (which is good, no point in having a forum full of Yes-men).

captain118 - you'll probably want to use the permissions associated with the share type. Unix for NFS and Windows for CIFS.
 

captain118

Dabbler
Joined
Oct 1, 2014
Messages
21
I currently have it configured for Windows and am using CIFS. However the plugin for crashplan will not mount the dataset. I'm fairly sure its because I am using windows permission type. As I am able to mount the datasets that use the unix file permission type.

I asked on this forum because of leenux_tux's comment, "You can also share folders using both CIFS and NFS as the same time."

When I tried using a CIFS share with unix permissions I kept getting prompted from windows for credentials.

I was hoping he would have the solution to my dilemma.

It wasn't until after I posted that I realized the thread's age. However its nice to see somehow people still see it.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I currently have it configured for Windows and am using CIFS. However the plugin for crashplan will not mount the dataset. I'm fairly sure its because I am using windows permission type. As I am able to mount the datasets that use the unix file permission type.

I asked on this forum because of leenux_tux's comment, "You can also share folders using both CIFS and NFS as the same time."

When I tried using a CIFS share with unix permissions I kept getting prompted from windows for credentials.

I was hoping he would have the solution to my dilemma.

It wasn't until after I posted that I realized the thread's age. However its nice to see somehow people still see it.

It gets bumped to the top of the list ;)

CIFS will pretty much only work with Windows permissions, no way around that. It's also not a good idea to share the same thing with two protocols, as conflicts often ensue.
 

leenux_tux

Patron
Joined
Sep 3, 2011
Messages
238
I have been using this method of sharing 3 folders via both NFS and SMB for like, since I was on V8. Has to be well over two years now and have never had a problem. I can't give exact specifics about the setup right now as I am working 200 miles from where I live, however, from a high level view...

Shared folders "MUSIC", "MOVIES", "ISO-IMAGES"

MUSIC and MOVIES are shared and accessed from 2 Windows (SMB), 2 Linux Mint (NFS) and a Google Nexus 10 (SMB).
ISO-IMAGES is shared and accessed from a VMWare ESXi system (NFS), and (mostly) 1 Windows system (SMB). All my software images re stored here so get accessed a lot from ESXi.

All of these shares are available for both Linux and Windows Virtual Machines as well from my ESXi system, VMWare Workstation, PROXMOX and VirtualBox. I am in the middle of testing alternate virtualization tech to VMWAre hence the myriad of VM software :smile:

I do have other volumes shared on the network but none are "dual" share types. I guess I have been lucky in that my setup, are far as users are concerned is not that complex as it is a home/home office setup.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah, you've been pretty lucky.

The problem is that each protocol handles its own file locking. So you can open a file in SMB and at the same time as saving a revision of the file save a revision from an NFS share to the same file. You'll find your file borked. ;)

Now you can get away with a little more than many other users if you are like me; the only user in the house and services that access files regularly are only given read-only permission. But that's definitely not absolute protection and you aren't likely to know that your file is corrupt because Samba and NFS do a little of their own caching on both the server and client side, so a given copy of a file can appear to be good just after you saved it, but next week when you open the file it is mysteriously corrupt.

Don't forget that many services and such that run in the background *will* happily open and manipulate bits on some files. For example, there's a program I experimented with that would fix problems in video files automatically when you opened the file. This could really backfire if you happened to open the same file at 2 different protocols at the same time. Adobe Acrobat (full version) has some thumbnails feature, and it will automatically correct certain kinds of corruption automatically.

Anyway, the manual provides a very stern warnings against this, and I have no doubt that some people are doing it and it works out fine. But I don't like to trust my data to luck, and in the bigger picture, CIFS is pretty much a reasonably good cross-platform file sharing protocol. So there's no overly large justification for requiring the same files be available on multiple protocols (and I have no doubt people could argue it, but in my 2 years here I've yet to hear an argument that isn't "because I just don't like CIFS" and full of emotion instead of cold hard scientific facts. Even as a Windows and Linux user I find CIFS performance in Linux is superior to Windows, and NFS support in Windows is crappy, at best.
 

captain118

Dabbler
Joined
Oct 1, 2014
Messages
21
I do not have any plans to use multiple sharing protocols on the same volume. I can definitely see how it could cause problems.

After playing with it some more I was able to get crashplan to see my data. The problem was I had to mount the dataset directly instead of mounting its parent folder.

Thanks for the input.
Kirk
 

9C1 Newbee

Patron
Joined
Oct 9, 2012
Messages
485
Yeah, you've been pretty lucky...........So you can open a file in SMB and at the same time as saving a revision of the file save a revision from an NFS share to the same file. You'll find your file borked. ;)

I've been trolling this forum for a little while now. I had no clue about this being a bad thing. I am using NFS for XBMC and SMB for the other junk. Looks like I need to reconfigure XBMC to utilize SMB and shut off NFS. Thankful for the necro. Otherwise I might not have received this little information nugget.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
It's in the manual in bold as as WARNING. Why not?
 

9C1 Newbee

Patron
Joined
Oct 9, 2012
Messages
485
Wow. Maybe I aught to RTFM sometime.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Actually, it's not in the manual as a WARNING. Just a note...


It's in the manual in bold as as NOTE. Why not?

NOTE:while the GUI will let you do it, it is a bad idea to share the same volume or dataset using multiple types of access methods. Different types of shares and services use different file locking methods. For example, if the same volume is configured to use both NFS and FTP, NFS will lock a file for editing by an NFS user, but a FTP user can simultaneously edit or delete that file. This will result in lost edits and confused users. Another example: if a volume is configured for both AFP and CIFS, Windows users may be confused by the extra filenames used by Mac files and delete the ones they don't understand; this will corrupt the files on the AFP share. Pick the one type of share or service that makes the most sense for the types of clients that will access that volume, and configure that volume for that one type of share or service.f you need to support multiple types of shares, divide the volume into datasets and use one dataset per share.
 
Status
Not open for further replies.
Top