Setting up NFS on a home linux box


Home Network

NFS Server Installation

I’ve built my own home server called (Orion) you can read the details here, currently, I’m in the process of installing NFS so that I can access my files from my Linux Workstation.

Home network Setup

Server IP:
Workstation IP:

Install NFS Server


Edit /etc/exports and add the shares:

The above shares /home/backup allows only my workstationion on my private network  to access the share.

rw makes the share read/write, and sync requires the server to only reply to requests once any changes have been flushed to disk. This is the safest option (async is faster, but dangerous. It is strongly recommended that you read man exports.

After setting up /etc/exports, export the shares:

You’ll want to do this command whenever /etc/exports is modified.

Restart Services

If /etc/default/portmap was changed, portmap will need to be restarted:

The NFS kernel server will also require a restart:

NFS Client Installation


Portmap Lockdown
Add the following line to /etc/hosts.deny:

By blocking all clients first, only clients in /etc/hosts.allow below will be allowed to access the server.
Now add the following line to /etc/hosts.allow:

Where “NFS server IP address” is the IP address of the server. This must be numeric! It’s the way portmap works.


Check to see if everything works. You should try and mount it now. The basic template you will use is:

so in my case, I would have:

Mount at startup

NFS mounts can either be automatically mounted when accessed using autofs or can be setup with static mounts using entries in /etc/fstab.

Static Mounts

Prior to setting up the mounts, make sure the directories that will act as mountpoints are already created.

In /etc/fstab, add lines for shares such as:

My fstab file looks like this, yours of course will probably look totally different

The rw mounts it read/write. Obviously, if the server is sharing it read only, the client won’t be able to mount it as anything more than that. The hard mounts the share such that if the server becomes unavailable, the program will wait until it is available. The alternative is soft. intr allows you to interrupt/kill the process. Otherwise, it will ignore you. Documentation for these can be found in the Mount options for nfs section of man mount.

The filesystems can now be mounted with mount /mountpoint, or mount -a to mount everything that should be mounted at boot.


Backing up my home directory to my mounted NFS filesystem.

Crontab setting to run runs every day at 10:30

Saved the following as


Leave a Reply