Samba sharing an NFS mount point

164

Solution 1

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.

Solution 2

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.

Solution 3

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.

Share:
164

Related videos on Youtube

FiniteLooper
Author by

FiniteLooper

Updated on September 17, 2022

Comments

  • FiniteLooper
    FiniteLooper over 1 year

    Is there a more efficient way to write the following script? All it's doing is updating the count of an item and then displaying the singular or plural text for that count depending on how many it finds.

    The code just seems redundant to say "show this one and hide this one, unless the opposite is true then hide this one and show that one". Shouldn't there be a way to pass a boolean into something that should show or hide based on that?

    var includedCount = $("#services").find("tbody tr td:nth-child(1) :checkbox:checked").length;
    var requiredCount = $("#services").find("tbody tr td:nth-child(2) :checkbox:checked").length;
    
    $("#js-included-num").html(includedCount);
    if(includedCount === 1){
        $("#js-included-plural").hide();
        $("#js-included-singular").show();
    }else{
        $("#js-included-plural").show();
        $("#js-included-singular").hide();
    }
    
    $("#js-required-num").html(requiredCount);
    if(requiredCount === 1){
        $("#js-required-plural").hide();
        $("#js-required-singular").show();
    }else{
        $("#js-required-plural").show();
        $("#js-required-singular").hide();
    }
    
  • Peter Nunn
    Peter Nunn over 14 years
    Thankyou so much for this.. I'll try it now and see what happens.. and report back. Peter.
  • Peter Nunn
    Peter Nunn over 14 years
    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,n‌​odev,async,lock 0 0 for what its worth. Peter.
  • Peter Nunn
    Peter Nunn over 14 years
    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.
  • churnd
    churnd over 14 years
    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: us5.samba.org/samba/docs/man/Samba-HOWTO-Collection/…, because it will support single sign-on which is a very nice feature to have.
  • warren
    warren about 14 years
    where in the docs is this? I'd really like to find it, myself :)
  • FiniteLooper
    FiniteLooper almost 13 years
    I'm aware of .toggle() but I'm disappointed that it doesn't take a boolean. Both of the elements are shown by default, the JS decide which one to hide or show.
  • FiniteLooper
    FiniteLooper almost 13 years
    Awesome thanks. This works great. I modified it a bit, but this is the base of it.
  • Alexej Magura
    Alexej Magura over 4 years
    So basically as long as both Samba and NFS are running on the same server it isn't a problem?