8

I'm sorry if this is a repeat post, seems my first attempt failed...

A little context first.

Firstly, I have inherited one of the classic networks from hell. Amongst a number of other things, I discovered that the majority of the clients data, including a heap of compliance data, is currently stored on one up USB drives being shared via Samba to the rest of the clients (and not being backed up).

To help me sleep at night, I've thrown together a linux files server with two raid 5 arrays to put this data on, and to avoid having to remap all of the client machines thought it should be OK to unmount the USB disks, after rsyncing the data to the file serve, and nfs mounting the new mount points in their place.

This seemed to work Ok with some quick testing, however, today I discovered that my users are having terribly trouble opening files across this arrangement with the file transfer rate being very very slow.

I don't see any problem with direct nfs mounting of the disks (from my linux box) but via the samba shares it is totally unusable.

I did use the default setting in both export and mount points no will play tonight with some of the options I have found on google, but am thinking I'll have to roll back for tomorrow at least.

Should I be able to do this? I can't see why not, as I'd guess it would be the sort of thing that would be done for a NAS system anyway.

Any advice? Please?

Starfish
  • 2,735
  • 25
  • 28
Peter Nunn
  • 452
  • 1
  • 11
  • 25
  • possible duplicate of [Windows hangs accessing a samba share with nfs backend](http://serverfault.com/questions/194673/windows-hangs-accessing-a-samba-share-with-nfs-backend) – Shane Madden Aug 28 '12 at 00:06

3 Answers3

4

nfs mount option nolock worked for me.

edit: you can add the 'nolock' to mount options in fstab, or 'mount -o nolock,remount /mount_path' to mount it on demand. I had an issue with samba creating a mount on an nfs volume and it created infinite open connections until I added this mount option.

Joshua
  • 3
  • 2
jamie
  • 41
  • 1
3

The Samba manual mentions that re-exporting a NFS mountpoint over Samba does not work correctly. NFS is not 100% POSIX compatible, so some things work differently than what Samba expects.

I.e. you should run Samba on the same server where you run the NFS service, exporting the local disks directly.

janneb
  • 3,841
  • 19
  • 22
2

Did you add the tuning fix to smb.conf?:

socket options = TCP_NODELAY IPTOS_LOWDELAY

The SAMBA howto gives more options and explanations: http://us1.samba.org/samba/docs/man/Samba-HOWTO-Collection/speed.html

The socket option TCP_NODELAY is the one that seems to make the biggest single difference for most networks. Many people report that adding socket options = TCP_NODELAY doubles the read performance of a Samba drive. The best explanation I have seen for this is that the Microsoft TCP/IP stack is slow in sending TCP ACKs.

churnd
  • 4,077
  • 5
  • 34
  • 42
  • Thankyou so much for this.. I'll try it now and see what happens.. and report back. Peter. – Peter Nunn Sep 24 '09 at 21:37
  • Bugger.. its already set. The odd thing is the speed of the usb mounted disks is quite good.. I just would have assumed the nfs mounts would have been fast too.. (well, guess they are if not going through samba first). The mount I'm using (from fstab) is 192.168.20.63:/home/onenergy2 /home/onenergy2 nfs rw,rsize=32768,wsize=32768,hard,intr,nfsvers=3,tcp,noatime,nodev,async,lock 0 0 for what its worth. Peter. – Peter Nunn Sep 24 '09 at 21:44
  • If, as it looks, I have to mount the shares directly on this second box as samba shares, a suplimentary question if I may.. .. what's the best way to push the users credentials across to this machine. Can I use the first machine (set as a domain controller) to authenticate the users on the shares on the new file server or do I need to copy the credentials between machines (yuck)? What do people suggest? This must be a fairly common issue for network storage I'm guessing. Thanks again. Peter. – Peter Nunn Sep 24 '09 at 21:46
  • If you're looking at keeping credentials synchronized, you'll need to look into some sort of centralized authentication such as OpenLDAP or Samba PDC. I would suggest Samba PDC if you can: http://us5.samba.org/samba/docs/man/Samba-HOWTO-Collection/samba-pdc.html, because it will support single sign-on which is a very nice feature to have. – churnd Sep 29 '09 at 13:24