1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to mount NFS client to NFS server?

Discussion in 'Tomato Firmware' started by leandroong, Nov 14, 2013.

  1. leandroong

    leandroong Addicted to LI Member

    Tomato Firmware 1.28.0000 MIPSR1-114 K26 USB AIO

    Experimenting, trying to mount my tomato router to main router (Rt-n15u) usb harddisk. My problem is setting NFS client. This is what I did?
    1. mkdir /mnt/nfs
    2. mount -t nfs 10.0.1.1:/media/AiDisk_a2 /mnt/nfs
    mount.nfs: rpc.statd is not running but is required for remote locking.
    Either use '-o nolock' to keep locks local, or start statd.

    How should I do it?
    Note: main router, content of /etc/exports
    /media/AiDisk_a2 10.0.1.0/255.255.255.0(rw,async,insecure,no_root_squash,no_subtree_check)
     
    Last edited: Nov 14, 2013
  2. leandroong

    leandroong Addicted to LI Member

    Got it. Correct syntax:
    mount -t nfs -o nolock 10.0.1.1:/media/AiDisk_a2 /mnt/nfs

    root@BTRouter2:/tmp/home/root# ls /mnt/nfs
    downloads lost+found opt
     
  3. leandroong

    leandroong Addicted to LI Member

    Automating mounting problem:
    1. edit /etc/fstab, add the ff:
    10.0.1.1/media/AiDisk_a2 /mnt nfs rw 0 0
    2. reboot router

    Problem: ls /mnt, does not create nfs folder. Any idea, how to do it correctly?
     
  4. leandroong

    leandroong Addicted to LI Member

    Workaround solution.
    1. edit init script, add the ff:
    ....
    modprobe bcm_nat
    mkdir /mnt/nfs
    mount -t nfs -o nolock 10.0.1.1:/media/AiDisk_a2 /mnt/nfs
    2. to test, ls /mnt/nfs, result is success.
     
  5. Almaz

    Almaz Serious Server Member

    Just curious, why would NFS require modprobe bcm_nat?
     
  6. leandroong

    leandroong Addicted to LI Member

    You dont need that.
     
  7. koitsu

    koitsu Network Guru Member

    Also, use of -o nolock on Linux means lack of exclusive NLM locking. This is fine if the only NFS client on your entire network is your router, but in no other circumstance is this advised. (All it takes is two separate NFS clients writing to the same file at the same time, with use of -o nolock, to have the contents of the file clobbered, truncated, or interspersed).

    Otherwise if you don't want to risk it, someone needs to include lockd and rpcbind (a.k.a portmapper) binaries (daemons) appropriately.

    Reference: http://linux.die.net/man/5/nfs
     
  8. leandroong

    leandroong Addicted to LI Member

    I test downloading using transmission and got halted 25% completion. Any idea?
     
  9. leandroong

    leandroong Addicted to LI Member

    Got same prolem on repeat transmission download, 63% completion. I notice that it killed transmission-daemon.
     
  10. leandroong

    leandroong Addicted to LI Member

    Seems to work only for small torrent file, below 50MB ...
     
  11. leandroong

    leandroong Addicted to LI Member

    Solution, decrease rsize and wsize values. Now transmission working without errors...

    Current values:
    root@BTRouter2:/tmp/home/root# cat /proc/mounts
    ...
    10.0.1.1:/media/AiDisk_a2/downloads /tmp/mnt/downloads nfs rw,vers=3,rsize=65536,wsize=65536,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,addr=10.0.1. 0 0

    change mounting to:
    root@BTRouter2:/tmp/home/root# mount -t nfs -o nolock,rsize=32768,wsize=32768 10.0.1.1:/media/AiDisk_a2/downloads /mnt/downloads
     
  12. leandroong

    leandroong Addicted to LI Member

    to unmount nfs client, issue "umount /mnt/downloads"
     
  13. leandroong

    leandroong Addicted to LI Member

    Here is the perfect mounting NFS client that works well with transmission:

    mount -t nfs -o nolock,intr,hard,timeo=14,sync 10.0.1.1:/media/AiDisk_a2/downloads /mnt/downloads

    note: sync is very important, it waits for NFS server write completion
     

Share This Page