View Source

To use PXE Network Boot, you need a working DHCP server, TFTP server, and NFS server. (Read more in [Prerequisites for Using PXE Network Boot]).

NFS server is used to keep the read-only image of PXE boot file system. To install NFS server on the Linux distribution that supports yum, such as Fedora, CentOS, and RedHat, run the following command:

{code}yum -y install nfs-utils{code}

!yum-y-install.png!
 
Other Linux distributions have their own methods of software installation. For example, on distributions that support aptitiude, such as Debian and Ubuntu, NFS server can be installed with the command

{code}apt-get install nfs-kernel-server{code}

!apt-get.png!

After the installation, you will have to create NFS share. NFS share is just a directory that can be mounted from remote clients. It is recommended that NFS share directory is not used for any other purposes. Create the directory to be shared over NFS with the command

{code}mkdir /nfsroot{code}

 
After creating the directory, open the file {color:blue}/etc/exports{color} in your favorite text editor.
\\

This file contains a list of NFS shares, IP addresses they can be mounted from, type of access (read-only or read-write), and other sharing options. Let's assume that your IP subnet with the servers for Bare-Metal Restore is {color:blue}192.168.5.0/24{color}. Add to {color:blue}/etc/exports{color} the following line:

{code}/nfsroot 192.168.5.0/24(ro,no_root_squash,no_subtree_check){code}

!nfsroot.png!
 
Save the file and run the following command:

{code}exportfs -r{code}

Then you can start NFS service by executing the following command:

{code}/etc/init.d/nfs start{code}

To make sure your NFS share is visible to the client, run the following command on NFS server:

{code}showmount -e{code}

!exportfs.png!

The command should return something like this:

{code}Export list for pxeserver:
/nfsroot 192.168.5.0/24{code}

{info:title=Note}NFS service depends on the portmap service and usually will not work if portmap is not running. But this dependency is not always hardcoded into the startup script, so sometimes the script will try to start NFS service without trying to find out if portmap is already started and start it if it is not. In such case NFS will fail to start. So if for any reason NFS service fails to start, try to start portmap first by executing the command

{code}/etc/init.d/portmap start{code}

{info}
Now you can proceed to [Installing PXE Network Boot].
{excerpt:hidden=true}Instructions on how to configure NFS server on Linux {excerpt}