NFS Mounting on Penn Desktops
To set this up correctly, you need to modify files on both the server and the client machines.
Server Modifications
First, you need to mount the disk locally. You can do this by adding it to
/etc/fstab
, so it's automatically mounted at boot time. You'll need to manually create the directory it maps to, as root. Here's an example from
pc-penn-d-02
:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
/dev/VolGroup01/LogVol00 /data ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
/dev/VolGroup00/LogVol02 /scratch ext3 defaults 1 2
none /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/VolGroup02/LogVol00 /exports/project/data_d02_1 ext3 defaults 1 2
/dev/VolGroup03/LogVol00 /exports/project/data_d02_2 ext3 defaults 1 2
/dev/VolGroup04/LogVol00 /exports/project/data_d02_3 ext3 defaults 1 2
To mount something without rebooting, you can run the
mount
command as root, like:
mount /exports/project/data_d02_1
Then you also need to put the directory in
/etc/exports
to export it, and list which machines have permission to see it. Example:
#
/exports/project/data_d02_1 pc-penn-s-01.cern.ch(rw,sync)
/exports/project/data_d02_1 pc-penn-d-01.cern.ch(rw,sync)
/exports/project/data_d02_1 pc-penn-d-02.cern.ch(rw,sync)
/exports/project/data_d02_1 pc-penn-d-03.cern.ch(rw,sync)
/exports/project/data_d02_1 pc-penn-d-04.cern.ch(rw,sync)
/exports/project/data_d02_1 pc-penn-d-05.cern.ch(rw,sync)
/exports/project/data_d02_1 pc-penn-d-06.cern.ch(rw,sync)
Afterward, you need to reload the export table for nfs:
/etc/init.d/nfs reload
You may also need to modify
/etc/sysconfig/iptables
to look like the one from d02, to set up the firewall correctly. If that's the case, then you should also do the following:
- Restart iptables:
-
/etc/init.d/iptables restart
- And make sure the nfs daemons are started (possibly will need restarted):
-
service portmap start
-
service nfslock start
-
service nfs start
Client Modifications
The Penn machines are set up to automount the shared directories. So instead of putting them in
/etc/fstab
, you instead create entries in
/etc/auto.project
. This file gives a list of directories to automount to
/project
on demand. So you need to
cd
to these directories to actually mount them. The first time you do this, it may take a long time (minutes!) to mount.
The base directory,
/project
, should probably already exist (or you can create it as root). But you don't need to (and can't) create empty directories for the mount points. These are created automatically on demand.
Here's an example of the
/etc/auto.project
file from
pc-penn-d-01
:
#
# $Id: PennNfsMounting.txt,v 1.4 2020/08/19 07:26:13 BaseUserMapping_333 Exp $
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
data0 pc-penn-s-01.cern.ch:/exports/project/&
data_d02_1 pc-penn-d-02.cern.ch:/exports/project/&
data_d02_2 pc-penn-d-02.cern.ch:/exports/project/&
data_d02_3 pc-penn-d-02.cern.ch:/exports/project/&
Then you may need to load the new info for autofs:
/etc/init.d/autofs reload
More Info
This page has some useful info:
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-guide/ch-nfs.html
--
DominickOlivito - 07-May-2010