Setup and Configure NFS Mounts on Linux Server Print

  • NFS, Linux
  • 0

Setup and Configure NFS Mounts on Linux Server
To setup NFS mounts, we’ll be needing at least two Linux/Unix machines.
Here in this tutorial, I’ll be using two servers

NFS Server: IP-
NFS Client: IP-

Installing NFS Server and NFS Client

We need to install NFS packages on our NFS Server as well as on NFS Client machine.
We can install it via “yum” (Red Hat Linux) and “apt-get” (Debian and Ubuntu) package installers.

Command for redhat/centos server

#yum install nfs-utils nfs-utils-lib
#yum install portmap (not required with NFSv4)

Command for ubuntu server

#apt-get install nfs-utils nfs-utils-lib

Now start the services on both machines

#/etc/init.d/nfs start
#/etc/init.d/rpcbind start

#chkconfig --level 35 nfs on
#chkconfig --level 35 rpcbind on

First we will be configuring the NFS server.

#mkdir /nfsshare
#vi /etc/exports

entry is file is like "/nfsshare,sync,no_root_squash)"

Setting Up the NFS Client

#showmount -e

Display message is
Export list for

Mount Shared NFS Directory


#mount -t nfs /mnt/nfsshare

For permannent mount

#vi /etc/fstab /mnt/nfsshare nfs defaults 0 0

#mount -a


Note: First disable iptables

By Gaurav Sharma

Thanks !

Was this answer helpful?

« Back