How to connect NFS on Linux - client
A quick tutorial on how to connect NFS on the client side
Some basic information about NFS (Network file system): a system that allows access to files on remote hosts/servers. It uses the RPC package to do this. The RPC or Remote Procedure Call package provides a very general mechanism for client-server applications.
Access to files on remote hosts is done in exactly the same way as user access to local files. This behavior is made possible by a combination of client-side operating system kernel functionality (which uses the remote file system) and server-side NFS (which provides the file data).
How to mount client-side NFS
If we have Linux using APT (Debian, Ubuntu, Mint, etc.), we need to install a few packages first:
sudo apt-get update
sudo apt-get install nfs-common
We create a directory where we want to mount the remote NFS folder:
sudo mkdir /srv/nfs-data
Mount:
sudo mount server_address:/nfs_server_directory /srv/nfs-data
Automatically connect to the NFS server when the client starts
Simple. Just add a line to /etc/fstab:
sudo nano /etc/fstab
For example, add it to the last line:
server_address:/nfs_server_directory /srv/nfs-data nfs auto,noatime,nolock,bg,nfsvers=4,intr,tcp,actimeo=1800 0 0
The server address can be its IP or domain name.
Done :)