DEV Community

Cover image for Add an NFS mount point to a Ubuntu Server
Sergio Peris
Sergio Peris

Posted on • Originally published at sertxu.dev

Add an NFS mount point to a Ubuntu Server

NFS allows us to mount a network share as a local device. This system uses the client IP address for authentication. Don't confuse it with SMB, which allows user and password authentication.

In this tutorial, we'll explain how to connect an NFS share to an Ubuntu Server as a client.

Install dependencies

First, we must install the dependencies.

apt install nfs-common
Enter fullscreen mode Exit fullscreen mode

Create a mount point

Once we've installed the dependencies, we must ensure the mount point we want to use exists.

mount -p /mnt/backups
Enter fullscreen mode Exit fullscreen mode

Add a persistent mount

Using the mount command, we can temporarily mount the NFS share. However, we'll modify the /etc/fstab file to make the mount persistent.

192.168.1.10:/Backups /mnt/backups nfs defaults,_netdev 0 0
Enter fullscreen mode Exit fullscreen mode

To apply the changes we've made at /etc/fstab we must run:

mount -a
Enter fullscreen mode Exit fullscreen mode

Now we can check that the NFS mount is working as expected.

df -h
Enter fullscreen mode Exit fullscreen mode
Filesystem                     Size  Used Avail Use% Mounted on
/dev/sda2                       30G  6.9G   21G  25% /
192.168.1.10:/Backups          916G  594G  322G  65% /mnt/backups
Enter fullscreen mode Exit fullscreen mode

Top comments (0)