Learn Devops tools online from the blog. Devops Institute Ahmedabad.

A Network File System (NFS) allows remote hosts to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to consolidate resources onto centralized servers on the network.


Server Ip :
Client  Ip :

An NFS server on linux requires 3 services to be running in order to share files:

Server Settings []:

Install nfs package using yum :
# yum install nfs-utils nfs-utils-lib portmap system-config-nfs

# chkconfig portmap on
# chkconfig nfslock on
# chkconfig nfs on

Set up your /etc/exports file with details of the directory you want to share, who is allowed to share it, and permissions.
# vim /etc/exports
/home/vishal or,no_root_squash,sync)

# service nfs restart

Client Settings []:-
Install NFS packages:
# yum install nfs-utils nfs-utils-lib portmap system-config-nfs

# mkdir /home/vishal
# chmod 777 /home/vishal

Mount command:
# mount -t nfs /home/vishal

Add an entry to fstab:
Paste an entry at the bottom of the file that looks something like this.         /home/vishal    nfs     noauto,rw,user 0 0

Make sure you can see the running services on the server by typing:

#rpcinfo -p [Server Ip]

Vishal Vyas

1 comment: