Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:nfs [2014/12/29 12:30] darrontools:nfs [2017/01/11 16:33] (current) – [autofs] darron
Line 1: Line 1:
 ==== NFS ==== ==== NFS ====
  
-==== Debian server ====+Network file system allows us to share files over the network. 
 + 
 +=== Debian server ===
 <code> <code>
 apt-get install rpcbind nfs-common nfs-kernel-server  apt-get install rpcbind nfs-common nfs-kernel-server 
Line 15: Line 17:
 </code> </code>
  
-==== Void Linux client ====+=== OpenWRT client ===
 <code> <code>
-echo "$SERVERADDRESS:/embedded /embedded nfs rw,noatime,noauto 0 0" >> /etc/fstab +modprobe nfsv3 
-mount $SERVERADDRESS:/embedded /embedded+modprobe nfs 
 +mkdir -p /embedded 
 +mount.nfs $SERVERADDRESS:/embedded /embedded -o nolock
 </code> </code>
  
-== /etc/modprobe.d/modprobe.conf =+=== Debian client ===
-<code> +
-blacklist rpcsec_gss_krb5 +
-</code> +
- +
-==== Raspbian client ====+
 <code> <code>
 apt-get install rpcbind nfs-common apt-get install rpcbind nfs-common
 sed -i 's/NEED_IDMAPD=$/NEED_IDMAPD=YES/' /etc/default/nfs-common sed -i 's/NEED_IDMAPD=$/NEED_IDMAPD=YES/' /etc/default/nfs-common
-mkdir -p /embedded/raspbian +mkdir -p /embedded 
-echo "$SERVERADDRESS:/embedded/raspbian /embedded/raspbian nfs rw 0 0" >> /etc/fstab+echo "$SERVERADDRESS:/embedded /embedded nfs rw 0 0" >> /etc/fstab
 /etc/init.d/rpcbind restart /etc/init.d/rpcbind restart
 /etc/init.d/nfs-common restart /etc/init.d/nfs-common restart
 mount -a mount -a
 </code> </code>
 +
 +=== Void Linux client ===
 +<code>
 +xbps-install nfs-utils
 +echo "blacklist rpcsec_gss_krb5" >> /etc/modprobe.d/modprobe.conf 
 +mkdir -p /embedded
 +echo "$SERVERADDRESS:/embedded /embedded nfs rw,noatime,noauto 0 0" >> /etc/fstab
 +echo "rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs defaults 0 0" >> /etc/fstab
 +
 +mkdir -p /etc/sv/rpcbind
 +echo "#\!/bin/sh\nexec rpcbind -f" > /etc/sv/rpcbind/run
 +chmod +x /etc/sv/rpcbind/run
 +ln -s /etc/sv/rpcbind /var/service
 +
 +mkdir -p /etc/sv/rpc.idmapd
 +echo "#\!/bin/sh\nexec rpc.idmapd -f" >> /etc/sv/rpc.idmapd/run
 +chmod +x /etc/sv/rpc.idmapd/run
 +ln -s /etc/sv/rpc.idmapd /var/service
 +
 +mount rpc_pipefs
 +mount $SERVERADDRESS:/embedded
 +</code>
 +
 +=== Debian autofs ===
 +
 +One you have an NFS client working you can remove the entry in fstab and use autofs to mount it instead.
 +
 +<code>
 +apt-get install autofs
 +echo "/- /etc/auto.data" >> /etc/auto.master
 +echo "/embedded -fstype=nfs $SERVERADDRESS:/embedded" >> /etc/auto.data
 +/etc/init.d/autofs restart
 +</code>
 +