Configuring NFS
under
IRIX 6.5
Prepared by:
Marc Lemay
Wednesday, February 14th, 2001
Last Modified: Thuesday, October 18th, 2001
The percent
character ('%') indicates the standard C shell prompt.
The sharp
character ('#') indicates the standard C shell prompt for root (commands
that must be run by the super-user).
NFS (Network
File System) is a very useful IRIX option.
It enables to share files and directories among several workstations.
NFS is a network
service that allows users to access file hierarchies across a network and treat
them as if they were local. File
hierarchies can be entire file systems or individual directories.
If NFS is not
installed on your workstation, then get it installed. See Mr. Claudio Testa
for this matter.
The XYZ baseline
resides on the hard-disk of the ithree workstation. If you need to log on ithree (with restrictions), you can use:
Login: secret
Password:
To work with
XYZ, a developer needs to have access to the following ithree directories:
/u/development/XYZ
/u/xyzlocal
So, on ithree, the super-user must permit
these directories to be mounted by other hosts.
This is achieved by modifying the /etc/exports file.
The ithree /etc/exports file:
#
# NFS exported filesystem
database (see exports(4) for more information).
#
# Entries in this file
consist of lines containing the following fields
#
# filesystem [ options ] [
netgroup ] [ hostname ] ...
#
# Filesystem must be
left-justified and may name any directory within a
# local filesystem. A backslash (\) at the end of a line permits
splitting
# long lines into shorter
ones. Netgroup(4) and hostname refer
# to machines or collections
of machines to which filesystem is exported.
#
/u/development/v5 indy10
topcweb.cn.ca one topcdev1 topcdev2 topcdev3 topcdev4 topclab3 mtlcfs mtlafs
mtlbfs topcstby itwelve nguyen11.cn.ca
/u/local indy10 topcweb.cn.ca
one topcdev1 topcdev2 topcdev3 topcdev4 topclab3 mtlcfs mtlafs mtlbfs topcstby
itwelve nguyen11.cn.ca
/u/production indy10
topcweb.cn.ca one topcdev1 topcdev2 topcdev3 topcdev4 topclab3 mtlcfs mtlafs
mtlbfs topcstby itwelve nguyen11.cn.ca
/u/irel indy10 topcweb.cn.ca
one topcdev1 topcdev2 topcdev3 topcdev4 topclab3 mtlcfs mtlafs mtlbfs topcstby
itwelve nguyen11.cn.ca
/u/development/XYZ devxyz1 devxyz3 topcdev1 topcdev2 topcdev3 itwelve one xyzlab4
/u/xyzlocal
devxyz1 devxyz3 topcdev1 topcdev2 topcdev3 itwelve one xyzlab4
Look at the last
two lines (in bold) of that file. The
name of your workstation must appear in the list. If this is not the case, then edit the file
to add the name of your workstation, and execute the command exportfs(1M) on ithree.
# exportfs -a
On your workstation, you must create two mount points
(empty directories) to mount the two exported directories from ithree:
% su
Password: XXXXXXXX
# mkdir -p /u/development/XYZ /u/xyzlocal
Now on your own
workstation, you must change the file /etc/fstab.
This is the file /etc/fstab actually on topcdev3:
/dev/root / xfs
rw,raw=/dev/rroot 0 0
ithree:/u/development/v5
/u/development/v5 nfs rw,hard,intr,bg 0 0
ithree:/u/local /u/local nfs
rw,hard,intr,bg 0 0
ithree:/u/irel /u/irel nfs
rw,hard,intr,bg 0 0
ithree:/u/development/XYZ /u/development/XYZ nfs rw,hard,intr,bg 0 0
ithree:/u/xyzlocal
/u/xyzlocal nfs rw,hard,intr,bg 0 0
This file is
read when the workstation boots and is used to mount automatically the remote
directories.
The last two
lines (in bold) indicates that two directories on ithree are to be mounted on this workstation.
If you’ve just
edited /etc/fstab, you can mount the remote NFS directories
using:
# mount -a -t nfs
(It means mount all
directories of type NFS.)
You can check
that it worked using the df(1) command:
%
df
Filesystem Type blocks
use avail %use Mounted on
/dev/root xfs 31111632 17433952
13677680 57 /
ithree:/u/irel nfs 17379152 13224176 4154976
77 /u/irel
ithree:/u/local nfs 17379152 13224176 4154976
77 /u/local
ithree:/u/development/v5 nfs 17379152 13224176 4154976
77 /u/development/v5
ithree:/u/xyzlocal nfs 17379152 13224176 4154976
77 /u/xyzlocal
ithree:/u/development/XYZ nfs 17379152 13224176 4154976
77 /u/development/XYZ
When a developer
adds a new file in the baseline, he is supposed to use the utility xyzadmin
(see the document XYZ-LDM Supporting Utilities). The command xyzadmin will add the new
file in the baseline (on ithree) and will
create a link to this new file in the personal XYZ directory of every other XYZ developers. For this reason, the
personal XYZ directory of every XYZ developers must be accessible to the other
XYZ developers through NFS.
This section
explain how to configure that.
Presently, we
have six XYZ developers. Their personal
XYZ directories are specified by a variable in a PERL script file in ithree:/u/xyzlocal/bin/xyzfunctions:
%LOCAL = ("marc" , "/usr/marc/XYZ",
"zdai" ,
"/usr/zdai/XYZ",
"robert" ,
"/usr/robert/XYZ",
"co" ,
"/usr/people/co/XYZ",
"son" ,
"/usr/people/son/XYZ",
"van" ,
"/usr/people/van/XYZ);
By the way, if new programmers are added, or if they
change their workstation's name, then this LOCAL variable must be edited of
course.
Create mount
points for NFS:
% su
Password: XXXXXX
# mkdir -p /usr/zdai/XYZ
# mkdir -p /usr/robert/XYZ
# mkdir -p /usr/people/co/XYZ
# mkdir -p /usr/people/son/XYZ
# mkdir -p /usr/people/van/XYZ
Edit the file
/etc/exports:
#
#
NFS exported filesystem database (see exports(4) for more information).
#
#
Entries in this file consist of lines containing the following fields:
#
#
filesystem [ options ] [ netgroup ] [ hostname ] ...
#
#
Filesystem must be left-justified and may name any directory within a
#
local filesystem. A backslash (\) at the
end of a line permits splitting
#
long lines into shorter ones.
Netgroup(4) and hostname refer
#
to machines or collections of machines to which filesystem is exported.
#
/ -rw,
access=devxyz1:xyzlab4:topcdev1:topcdev2:topcdev3,root=devxyz1:xyzlab4:topcdev1:topcdev2:topcdev3,nohide
Run the command exportfs as root:
# exportfs -a
Edit the file /etc/fstab:
#
/etc/fstab for devxyz3.cn.ca
#
By Marc Lemay
/dev/root
/ xfs rw,raw=/dev/rroot 0 0
devxyz1:/usr/zdai/XYZ /usr/zdai/XYZ nfs rw,bg,soft,timeo=10 0 0
xyzlab4:/usr/robert/XYZ /usr/robert/XYZ nfs rw,bg,soft,timeo=10 0 0
topcdev1:/usr/people/co/XYZ /usr/people/co/XYZ nfs rw,bg,soft,timeo=10 0 0
topcdev2:/usr/people/son/XYZ /usr/people/son/XYZ nfs rw,bg,soft,timeo=10 0 0
topcdev3:/usr/people/van/XYZ /usr/people/van/XYZ nfs rw,bg,soft,timeo=10 0 0
ithree:/u/development/XYZ /u/development/XYZ nfs rw,bg,retry=1,timeo=50,retrans=4,soft,0 0
ithree:/u/xyzlocal /u/xyzlocal nfs
rw,bg,retry=1,timeo=50,retrans=4,soft,0 0
Execute the
mount command as root now:
# mount -a -t nfs
Repeat the same procedure to configure all other workstations.