Home > Linux > RHEL/CentOS NFS installation

RHEL/CentOS NFS installation

To set up NFS installation server, first locate and edit /etc/exports with the preferred NFS path.

  • vim /etc/exports -> put the path. Let say, /var/ftp/pub/CentOS-5.2

NOTE :- For file editing you can use your favorite file editor. In this case I’m using “vim”, which I’m very much comfortable with. In your case it might be some thing else. Can be either nano , emacs OR gedit. If you newbie, then I’m recommending vim for you.

TO GET START WITH VIM, Type “vimtutor” in your shell. The Vim tutor.

Back on NFS again…..

  • exportfs -ua -> will umount all exported file systems
  • exportfs -ra -> will remount all exported file systems
  • showmount -e hostname -> will list all exported file systems in hostname

If iptables ON, nfs probably won’t work. Most probably your nfs ports must be blocked by firewall. First clarify whether the firewall is turned on OR off in you machine.

  • service iptables status – will give the iptables status

If iptables turned on, then get a list of applied iptables rules. To do so,

  • iptables -L | less – will list current iptables rules.

If you see four strings in the below format, probably nfs might work over the firewall for you.

iptables -A INPUT -s 192.x.x.x/24 -p tcp –dport 111 -j ACCEPT
iptables -A INPUT -s 192.x.x.x/24 -p udp –dport 111 -j ACCEPT
iptables -A INPUT -s 192.x.x.x/24 -p tcp –dport 2049 -j ACCEPT
iptables -A INPUT -s 192.x.x.x/24 -p udp –dport 2049 -j ACCEPT
NOTE :- IP addresses used here are belong to IPV4 private ranges. Replace it with yours.

If not we need to allow nfs over iptables. To allow NFS over iptables :-

  • iptables -A INPUT -j ACCEPT

NOTE :- More general rule that will allow all incoming traffic through the firewall. Later I’ll discuss nfs over firewall in much detail in some other post.

  • service iptables save; restorecon -R /etc/sysconfig/* – will save iptables settings and restore selinux context.
  • service iptables restart.

nfs should be OK over iptables by now. Let’s get start the installation.

Start system with the help of the boot CD/DVD. In the boot: prompt, Either you can press enter and go ahead with booting the system, which later prompt for the installation method OR Press F2 and go to options and invoke “linux askmethod”. In each you’ll be asked to select language , keyboard , and installation method. Select “NFS” for installation method.

To Configure TCP/IP, you can use either static IP or DHCP. If you have DCHP server in place use DHCP or use a correct static IP.

NOTE :- you will find DHCP settings in a up coming post.

In NFS setup ->

under the nfs server name : use name OR IP of the NFS server
under the CentOS/RHEL directory : /use/correct/path/

If everything went right system should start the installation. 🙂

Categories: Linux
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: