Wednesday, February 23, 2011

NFS Configuration

You may be ask to setup an NFS service during the test. You may also want to setup an NFS share to make install CD images (ISOs) available to make system installs quick and easy while you study.

This makes more since if you have real hardware but you can do this with two VMware systems.
Contents
[hide]

* 1 Make sure NFS is installed.
* 2 Creating an NFS Share
* 3 Mounting an NFS Share
* 4 Creating an Installation Tree
o 4.1 With a DVD:
o 4.2 With CD-ROMs:
o 4.3 Check iptables
* 5 Sharing with HTTPD
* 6 Sharing with FTP

Make sure NFS is installed.

This is easy just make sure the package is installed.

rpm -qa | grep nfs
nfs-utils-1.0.9-16.e15

If you do not get this message it is not installed and to install it just run yum.

yum install nfs-utils

Creating an NFS Share

To share out data with NFS first make the directory to be shared.

mkdir /isos

Then put the full path to this directory into /etc/exports and give everyone (*) read only access (ro). Then verify this is understood.

echo "/isos *(ro)" > /etc/exports
exportfs -a

Next restart the NFS server and make sure it is persistent between reboots.

service nfs restart
chkconfig nfs on


Mounting an NFS Share

You use the mount command with the file system type (-t) nfs to mount an NFS share. Like mounting other network file systems you first tell mount host and service to mount (host:service) then where to mount it on your system.

mount -t nfs hostname:/isos /mnt/point

Creating an Installation Tree

Because I need to install Linux several times I have chosen to use a network install. This way I don't have to swap CD-ROMS. Network installs can be done via NFS, FTP or HTTP. I decided to setup all three. Here are the steps I used.

If you have CD and not the ISO files used to create them you can copy them back to files.
With a DVD:

dd if=/dev/dvd of=/isos/RHEL5.iso

where dvd refers to your DVD drive device.
With CD-ROMs:

dd if=/dev/cdrom of=/isos/diskX.iso

where cdrom refers to your CD drive's device, and X is the number of the disk that you are copying, beginning with 1 for the first disk, and so on.


Check iptables

To turn off any firewall you have running:

service iptables stop
chkconfig iptables off


Sharing with HTTPD

HTTPD installs the same as NFS except you should copy files to /var/www/html/inst and then restart the httpd server. I created a simlink to this directory.

ln -s /isos /var/www/html/isos

Sharing with FTP

This also works like the NFS process except you copy the files into /var/ftp/pub/inst and restart the vsftpd service. I created a simlink to this directory.

ln -s /isos /var/ftp/pub/isos

No comments:

Post a Comment