How to setup a NFS Client on Ubuntu

Hello Friends, this article is the continuation of the article “How to setup a NFS Server on Ubuntu“. I am showing how to install NFS on a client machine and mount a NFS share. This is the NFS Client how to.

NFS Client
NFS-Client

Installation & Configuration

Setting up the NFS Client is fairly simple and does not require lots of configuring. Lets get started by updating the client machine with the following commands:

sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y

Next lets install the NFS client with the following command:

sudo apt install nfs-common -y

and create a directory where the NFS Share is going to be mounted at with this command:

sudo mkdir -p /mnt/nfs-share

that’s all for the preparation and the next step is to simply mount the NFS Share. It can be done manually with the following command:

sudo mount 192.168.1.2:srv/nfs /mnt/nfs-share

You can confirm the mounted share with the following command:

mount -t nfs

Automatically mounting

There is also a way to mount a NFS Share automatically during the boot up procedure. Go ahead and edit the file /etc/fstab with the following command:

sudo vim /etc/fstab

add the following line towards the end of the file:

# <Source system & path> <mount directory> <fs type> <options> <dump> <pass>
192.168.1.2:/srv/nfs /mnt/nfs-share nfs defaults 0 0

That is it.

Conclusion

As you can see mounting an NFS Share is not too complicated and it can be really convenient if you mount it during the boot up procedure. That way one has not to worry about it and it is available when needed. Hopefully you this short article is useful and if you have further article ideas please provide them to me and I add them to my list.

If you like to read more about NFS go here

Ciao!