User Tools

Site Tools


doc:howto:nfs.client

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:howto:nfs.client [2012/11/30 16:45]
karlp added nfs4 vs nfs3 workaround for fedora
doc:howto:nfs.client [2014/05/17 15:46] (current)
tmomas typo correction + cosmetics
Line 1: Line 1:
 +====== NFS client ======
  
 +''​
 +Package: nfs-utils
 +Version: 1.1.6-1
 +Depends: libwrap, libblkid, libuuid, libevent
 +Size: 33390
 +Description:​ Updated mount.nfs command - allows mounting nfs4 volumes
 +
 +Package: kmod-fs-nfs
 +Depends: kernel (= 2.6.32.27-1),​ kmod-fs-nfs-common
 +Size: 86611
 +Description:​ Kernel module for NFS support
 +
 +Package: kmod-fs-nfs-common
 +Depends: kernel (= 2.6.32.27-1)
 +Size: 133604
 +Description:​ Common NFS filesystem modules
 +''​
 +
 +**WARNING:​** The librpc is missing in some versions. You can safely use ''​-force-depends''​ if it happens to you
 +
 +Note that to use ''​mount -t cifs'',​ NFS mount support in busybox has to be enabled.
 +
 +==== Configuration ====
 +<code bash>
 +mkdir /​mnt/​remote2
 +mount.nfs //​192.168.2.254/​router_main /​mnt/​remote2 [-rvVwfnh ] [-t version] [-o options]
 +</​code>​
 +<code bash>
 +mount -t nfs 192.168.1.101:/​share /mnt/point -o nolock
 +</​code>​
 +<code bash>
 +# For Fedora 17+ servers, which are nfs4 out of the box...
 +mount -t nfs 192.168.255.124:/​home/​karlp/​src src -o nfsvers=3 -o nolock
 +</​code>​
 +
 +The ''​nolock''​ will disable NFS file locking. If you really need file locking, you must install the **''​portmap''​** package and start the ''​portmap daemon''​ before trying to mount an exported filesystem without the ''​nolock''​ option.
 +
 +In some revisions mounting is not possible because default disabled in kernel: BUSYBOX_CONFIG_FEATURE_MOUNT_NFS [=n]
 +
 +Read [[http://​linux.die.net/​man/​8/​mount.nfs|manpage of mount.nfs]]
 +
 +Put it in ''​[[doc/​howto/​notuci.config#​etcfstab|/​etc/​fstab]]''​.
 +
 +==== Throughput Issues ====
 +Since [[doc:​howto:​netfilter]] will track every connection, if you use MASQUERADING for example, you could disable con-tracking for data connections:​
 +<code bash>
 +$IPT -t raw -A PREROUTING -i $IF_LAN -s $NET_LAN -p tcp --sport 32777:32780 -j CT --notrack #---------- don't track nfs
 +$IPT -t raw -A PREROUTING -i $IF_LAN -s $NET_LAN -p udp --sport 32777:32780 -j CT --notrack #---------- don't track nfs
 +$IPT -t raw -A OUTPUT -o $IF_LAN -d $NET_LAN -p tcp --dport 32777:32780 -j CT --notrack #---------- don't track nfs
 +$IPT -t raw -A OUTPUT -o $IF_LAN -d $NET_LAN -p udp --dport 32777:32780 -j CT --notrack #---------- don't track nfs
 +</​code>​
 +
 +Note this is not the same as for the server, the source and destination ports differ. The INPUT is for when you read from the remote filesystem and the OUTPUT for when you write to it.