HOWTO setup NFS for the online computers

From GlueXWiki
Revision as of 10:34, 29 January 2013 by Davidl (Talk | contribs) (Configuring NFS Clients)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page was written to document how the gluon02-gluon05 machines were configured to mount a directory from gluon02 via NFS. The intent is for gluon02 to serve as a temporary file server for the gluon machines until the dedicated server is delivered and installed.

The gluon machines are running Red Hat Enterprise Linux 6.3

Configuring NFS server

  • Create a directory to that you wish to export:
mkdir /group/gluoncfs


  • Edit the file /etc/exports
    This should specify a range a range of IP addresses, but for now, each of the 4 machines in the counting house are listed individually. (Yes, it is unnecessary to list gluon2 since it is the host machine, but I did it anyway)
    The lines look like this:
/group/gluoncfs   129.57.172.11(rw,no_root_squash,async)
/group/gluoncfs   129.57.172.12(rw,no_root_squash,async)
/group/gluoncfs   129.57.172.13(rw,no_root_squash,async)
/group/gluoncfs   129.57.172.14(rw,no_root_squash,async)


  • Fire up the nfs server:
/etc/init.d/nfs start


  • Enable the NFS service so it starts automatically on reboot
    1. Go to System->Administration->Services.
    2. When the window finally gives you control, select "nfs" and hit the green "Enable" button
    3. Note that I did not reboot gluon02 after doing doing this and just assume it will work


Configuring NFS Clients

  • Edit the file /etc/fstab to include a line like this:
gluon02:/group/gluoncfs  /group/gluoncfs  nfs tcp 0 0


  • Create a directory as the mount point
mkdir /group/gluoncfs


  • Mount the NFS volume
 mount /group/gluoncfs


  • This should auto-mount on reboot since it is in /etc/fstab, but only if gluon02 is already up and running. If it is not, there may be some sort of delay on startup while it times out. This was not tested.

Setting up home directories

The "right" way to do this is probably to set the home directory in a configuration file at the system level. (A stand-alone system would do this in /etc/passwd but I don't know how to do it when using NIS)

What I did was on the client machine:

  1. Create a directory /group/gluoncfs/home/davidl (need to be root to do this)
  2. Change owner to davidl via: chown davidl /group/gluoncfs/home/davidl
  3. Change permissions: chmod 755 /group/gluoncfs/home/davidl
    • (this is needed to allow ssh to use my keys in .ssh for password-less logins)
  4. Rename my default home directory in /home to davidl.old
  5. Create a symbolic link in /home pointing to /group/gluoncfs/home/davidl


Now I have the same home directory (hosted by gluon02) no matter which gluon machine I log into.