Mount NFS Client

Problem:
You need to access to a Shared folder from other server from your raspberry PI, this folder is shared troncut the network using a NFS Server

Solution:
Follow the next commands to setup a NFS client in your Raspberry:


1.- Install the required software


sudo apt-get install nfs-common -y

2.- Create the local folder to associate the link between the current system and the remote folder


sudo mkdir -p /media/MyUSB/

3.- Add permission to NFS folder, change owner and group


sudo chown -R pi:pi /media/MyUSB/


4.- mount the folder

sudo mount serveripaddress:/remotefolder /media/MyUSB/
use "df" command to see if the folder is correctly mounted

5.- setup fstab

sudo nano /etc/fstab

add the next line to fstab file:

remoteserveripaddress:/remote/folder/   /media/MyUSB   nfs    rw  0  0
done, now reboot the system and then you will be able to see the shared content in the mounted drive /media/MyUSB

Notes:
- If you are able to see you NFS folder from other computer but you can't write to it, check that all users have the same ID and SGID than the owner for the shared folder in the server
- If you need to make any change, you can use sudo umount /dev/xxx  to unmount the unit and mount it again with the command sudo mount -a
- to list all mount units in the computer use the command df