Share, , Google Plus, Pinterest,

Print

Posted in:

Configure NFS server on CentOS 6

Learn how to configure NFS server on CentOS 6.x! NFS stands for a Network File System. Network File System is a protocol which allows user on a client computer to access files and folders over a network. It is a network file sharing protocol built on the Open Network Computing Remote Procedure Call (ONC RPC) system. NFS is a server/client oriented protocol, which means that in order to share files and folders with your NFS clients you first need to configure NFS server!

Configuration of NFS server is easy and straight forward. Following this How To guide you will be able to configure NFS server on CentOS 6.X.

NFS Server
NFS Server

Let’s start our How To configure NFS server guide!

1. Install nfs-utils and dependencies.

[root@foo1 ~]# yum install nfs-utils -y

2.Edit /etc/exports file

Next we need to edit /etc/exports file and add information about the folder we desire to share via NFS, IP addresses of the NFS clients that will be allowed to mount the NFS server share and NFS options for the share (you can add multiple hosts with different mount options or use a wildcard * for any – read more about this HERE).

syntax for /etc/exports is:
/folder  IPADDRESS(nfs,options)

IP address of NFS server in our example is 192.168.1.100 and NFS clients address 192.168.1.101

[root@foo1 ~]# mkdir /nfsshare
[root@foo1 ~]# echo "/nfsshare 192.168.1.101(rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports

3. Export NFS filesystems

We need to export all NFS shares on our NFS server to make it available for our NFS clients! You can also restart nfs service…

[root@foo1 ~]# exportfs -a

4. Start rpcbind and NFS

[root@foo1 ~]# /etc/init.d/rpcbind start
[root@foo1 ~]# /etc/init.d/nfs start

5.Check showmount

Now you can check if the NFS shares were exported with showmount command.

[root@foo1 ~]# showmount -e 192.168.1.100
Export list for 192.168.61.100:
/nfsshare 192.168.1.101

Voila, you have configured your NFS server and first NFS share. You can now try to mount NFS share from your NFS client!

Read my post “How to mount NFS on CentOS 6” for more information!