How to Set Up and Configure NFS Server and Clients

By Zhiqiang Ma On Dec 23, 2012

NFS is widely deployed and used even after more than twenty year. NFS is easy to set up and easy to use. This introduces how to set up the NFS server and clients. We use the Fedora system as the example.

Set up a NFS Server

Configure /etc/exports to give clients the permission to use the NFS directories.

Edit /etc/exports

For example, to allow the servers inside subnet 10.0.0.1/24 to mount the /home directory with read/write permission. Add this line to /etc/exports:
/home 10.0.0.1/24(rw)
For details of the exports functions, please refer to export manual.

Start up the NFS service

Enable nfs service on the NFS server so that the NFS service daemon automatically starts each time the server starts:
# /sbin/chkconfig nfs on
You may also manually start it
# service nfs start

Client-slide configuration

Package installation

Install the nfs-utils package:
# yum nfs-utils

Start the rpcbind service

Start the service needed by NFS:
# service rpcbind restart
You may also set it to start automatically
# chkconfig rpcbind on

Mount the NFS directory

You can mount the NFS directory to the mount point:
# mount NFSSERVER:/lhome/userdir MOUNTPOINT
where NFSSERVER is the NFS server’s address, and MOUNTPOINT is the local mount point on the client side for the NFS directory.

You may also consider using autofs on top of NFS as described in Unified Linux Login and Home Directory Using OpenLDAP and NFS/automount.

By: Zhiqiang Ma Last updated: Dec 23, 2012 Views: 1,065
Tags: , , , , , , , , , , , , , , , ,

About Zhiqiang Ma

Zhiqiang Ma is a PhD candidate at Dep. of CSE, HKUST. He is interested in system software for cloud computing, virtualization of large-scale distributed system, etc. Find Zhiqiang on Facebook, Twitter, LinkedIn and Google+.

One Comment to How to Set Up and Configure NFS Server and Clients | Add Comment
Add your comments, share your thoughts

Be nice. Keep it clean. Stay on topic. No spam.