Posts Tagged Samba

Samba vs NFS on DNS-323

So far, I was using Samba to share the files stored on my D-Link DNS-323. However, people tend to say that NFS is quicker than Samba. So let’s benchmark those two protocols and figure out which one is actually quicker.

First of all, here is my configuration:

Server Client
D-Link DNS-323
Linux dlink-5610E5
Samba 3.0.24
UNFS3 0.9.20
Raspberry Pi
Linux alarmpi 3.6.11-15-ARCH+
CIFS utils 6.1-1
NFS utils 1.2.8-9

I used IOzone to benchmark these protocols from the Raspberry Pi. You can find the package for Arch Linux ARM on one of my previous post.

I first mounted the Samba and NFS share drives in the two respective folders /mnt/storage_smb and /mnt/storage_nfs.

I then ran the following commands (not at the same time):

iozone -RazcR -U /mnt/storage_smb -f /mnt/storage_smb/testfile -b smb_excel_output.xls
iozone -RazcR -U /mnt/storage_nfs -f /mnt/storage_nfs/testfile -b nfs_excel_output.xls

You can download the output files here and here.

Or, you can simply have a look at a summary of these two files in the following table which basically compare the average speed (in Kbytes per second) for both Samba and NFS:

Samba NFS
Write 7683 6676
Re-write 7544 6795
Read 21862 50464
Re-read 22383 50210
Random read 6348 6444
Random write 7603 6751
Backward read 5909 5246
Record rewrite 80294 87225
Stride read 15629 11868
Fwrite 7471 6700
Re-fwrite 7494 6671
Fread 7739 7685
Re-fread 7596 7639

As you can see, it looks like NFS is quicker for read operations but slower for write operations than Samba. But please remember that this is true for this very specific configuration ; It could be completely different for another one.

In conclusion, I personally decided to use both Samba and NFS depending of what I need. If I need a read only access to my data, I use NFS. However, if I need to write data, I use Samba.

NB: Another reason why I didn’t completely stop using Samba is because symbolic links don’t work with NFS. Instead, you need to use binding (mounting a folder inside another folder), but this is kind of incompatible with my use of rsync to backup my data. ๐Ÿ™

, , , , , , ,

No Comments

Samba access problem with Mac OS X 10.6+

This is a problem I encountered when I upgraded Mac OS X from the version 10.5 (Leopard) to 10.6 (Snow Leopard). One of my friend also got a similar problem when she upgraded to the version 10.7 (Lion).
This issue was affecting the access to the network shares set up with Samba (version 3.0.24) on my D-Link DNS-323. For some reason, I wasn’t able to authenticate on the shares as soon as I upgraded to Snow Leopard!

Here is the error message I was getting:

After browsing a few forums on the web, I finally found a solution. ๐Ÿ™‚
I simply had to change the security mode in the Samba configuration file (smb.conf) to read:

security = USER

Note that this property can be found under the [global] section.

For more information about the Samba security mode, please read the following article by Jack Wallen:
Understanding Samba security modes

, , , , ,

No Comments

Permissions ignored with Samba

After the issue regarding the ntpd process, I encountered another problem with my D-Link DNS-313. This time it was about permissions problem using Samba.

Because I have multiple user accounts sharing the same data, I added the following lines into the Samba configuration file (smb.conf):

create mask = 0774
directory mask  = 0775
force create mode = 0774
force directory mode = 0775

With these properties, a user will have the permission to read any files created by another user and will also be able to edit them if both users are part of the same group.

However, it appeared that these properties had been ignored by Samba! ๐Ÿ™ Please note that the client was a Mac OS X 10.6.6 (Snow Leopard) and the Samba version on the NAS was 3.0.25a.

After some googling on the web, I found the following explanation on the forum:

Samba 3.0.2x has the ‘unix extensions’ option set to ‘on’ by default. This allows Unix users who write to the Samba shares to set their own permissions bits. Mac OS X up until now has never attempted to do this, but from Leopard, any directory that gets created on a Samba share, get chmod’ed through this Samba extension.

Alright, this is clear enough! This means that we have to set the ‘unix extensions’ option to ‘no’ in our Samba configuration file:

unix extensions = no

The problem should be gone after restarting Samba. ๐Ÿ™‚

, , , , , ,