install NFS server Centos / Red hat

1. Install NFS and Create Directories

The first step is to create a NFS server if one is not already set up. The client OS filesystem lives (is stored) on that NFS server. As part of the PXE boot process a host with a PXE boot enabled network card, will issue a broadcast for a an IP address, and be provided that IP assignement by DHCP server aloing with a optional field for a so-called ‘next-server’ and an initial boot image to chain load after the minimal boot image used by the network card (from ROM, or other source) . The host the retreives its files and configurations from the NFS share configured in this section.

Having spare disk space available in the NFS export becomes a necessity as one starts adding more than one variety of an installation, because the entire client system OS will be copied to the NFS server. Customarily, the end user /home is not carried in those images, but separately mounted. Go ahead and install the NFS packages if they aren’t already installed on your server.


# yum install nfs-utils nfs-utils-lib sytem-config-nfs

Next, create the directories that you will be needing later on. These will be the actual NFS shares specified. If you want to put these somewhere else, or you can to specify different names, do so. You can share them from anywhere. The first directory will host a server installation of CentOS4, and the second directory a CentOS installation with a desktop environment.


# mkdir -p /var/backup


2. Configure NFS Mounts

Now you need to create the actual shares with read-write permission and start the NFS server.


# vim /etc/exports
/var/backup              *(rw,sync,no_root_squash)

Start the NFS server and verify the NFS shares are ok and start the service. If NFS services are already running, then reload them.


# service nfs start (reload)
# chkconfig nfs on
# nfs-export -l

Client side Mount

edit your  /etc/fstab

# vi /etc/fstab

add this line

server_ip:/var/backup /mnt/backup nfs defaults 0 0

exit and run this

# mount -a

check the mount point with


#df -h



WP Twitter Auto Publish Powered By :