Support #645
Updated by Daniel Curtis almost 7 years ago
{{>toc}} This is a guide on mounting a remote NFS share on Arch linux. h2. Prepare the environment * Make sure the system is up to date: <pre> sudo pacman -Syu </pre> h2. Setup NFS Server * Install nfs-utils package: <pre> pacman -S nfs-utils </pre> * Edit the @exports@ file: <pre> vi /etc/exports </pre> #* Setup a read-only public share to the 192.168.1.0 network: <pre> /srv/nfs/public 192.168.1.0/24(ro,all_squash,insecure,no_subtree_check) </pre> * Start and enable the nfs-server at boot: <pre> systemctl enable nfs-server systemctl start nfs-server </pre> h2. Mount the NFS Share * Install nfs-utils package: <pre> sudo pacman -S nfs-utils </pre> * Start and enable rpcbind.service,nfs-client.target and remote-fs.target services at boot: <pre> sudo systemctl enable rpcbind.service sudo systemctl enable nfs-client.target sudo systemctl enable remote-fs.target sudo systemctl start rpcbind.service sudo systemctl start nfs-client.target sudo systemctl start remote-fs.target </pre> h3. Manual Mounting For NFSv4 mount the root NFS directory and look around for available mounts: <pre> mount nas.example.com:/ /mountpoint/on/client </pre> * Mount Then mount omitting the server's NFS share: export root: <pre> mount -t nfs nas.example.com:/srv/nfs/public /media/public nas.example.com:/music /mountpoint/on/client </pre> #* If mount fails try including the server's export root (required for Debian/RHEL/SLES, some distributions need -t nfs4 instead of -t nfs): <pre> Mount -t nfs nas.example.com:/full/path/to/music /mountpoint/on/client </pre> h3. Mount Using /etc/fstab * Using fstab is useful for a server which is always on, and the NFS shares are available whenever the client boots up. Edit /etc/fstab file: <pre> vi /etc/fstab </pre> #* And add an appropriate line reflecting the setup. Again, the server's NFS export root is omitted. <pre> nas.example.com:/srv/nfs/public nas.example.com:/music /media/public /mountpoint/on/client nfs nfs4 rsize=32768,wsize=32768,timeo=900,retrans=5,_netdev rsize=8192,wsize=8192,timeo=14,_netdev 0 0 </pre> h2. Resources * https://wiki.archlinux.org/index.php/NFS