COMMAND NAME:

        ALLEGRO APPLICATION ALERT

        4.1.21:  The Network File System (NFS)

        by Frank Farmar

OVERVIEW

        This paper is an overview in the use of NFS to mount remote file systems.
It is not intended as a full tutorial on the use of NFS.

        NFS gives systems the ability to share disks over a network. In NFS,
a system that makes its disk available to the network is an NFS server
while the system that mounts an NFS disk is an NFS client. Systems
may be both NFS clients and servers and you may make all your network
systems both clients and servers. An NFS server exports" filesystems
to clients.

        In mounting NFS disks, you must mount filesystems that are writable
by the client as hard or risk having corrupted data.
The NFS Client" section discusses this issue.

        The syntax of a name enclosed in angle brackets, <name>," indicates
that a user supplied variable is needed.

NFS SERVER

        To create an NFS server, you must first place the filesystems you
wish exported in the /etc/exports" file. If you change the exports
file, you must run /etc/exportfs -a" or reboot your system.

        In UNIX, a typical disk is broken into several smaller minidisks called
partitions. When these partitions are used for file storage, they
are called filesystems. To link a filesystem with the UNIX directory
structure it must be mounted on a directory. This is called the filesystem's
mount point. A SUN with a single disk typically has two filesystems;
root with its mount point /" and user with its mount point /usr".

        To have an NFS server advertise its exportable filesystems you must
edit (or create) the /etc/exports" file. In its basic configuration,
this file contains the mount points of the
filesystems you wish to export, one per line. There are
additional options that place restrictions on the exported filesystems. 
Refer to ULTRIX manual for more information.

        The mount points on your particular system are found by executing
a df" command. Local filesystems have /dev" as part of their
filesystem name. The filesystem mount point is the last column of
the df" report, Mounted on".

        Once you complete editing the exports file either reboot the workstation
or type /etc/nfsd 4" to start the NFS server.

NFS CLIENT

        A NFS client imports additional filesystems from NFS servers. A client
need not mount the base of an NFS filesystem but can mount any subdirectory
under a server's mount point. There are typically two types of NFS
mounts, soft and hard. File systems mounted read-only" are normally
soft mounted while read-write" filesystems must be hard
mounted. If you have a writable NFS mount that is soft mounted,
file corruptions such as truncations may occur.

        Mounting a filesystem via NFS requires a /etc/fstab" entry and
a mount point creation via the mkdir (make directory) command. The
fstab entries for both read-only and read-write file systems are as
follows:

        Read-only NFS mount <
system>:<fsname> <dir> nfs ro,soft,bg,noquota 0 0

        Read-write NFS mount
:<fsname> <dir> nfs rw,hard,bg,intr,noquota 0 0

        Examples:
batman:/usr /usr nfs ro,soft,bg,noquota 0 0
batman:/usr/home /home rw,hard,bg,intr,noquota 0 0

        where:
system - name of the NFS server
fsname - file system name of the mount point on
the NFS server
dir - mount point directory on the client

RECOMMENDATION FOR DIRECTORY ORGANIZATION

        The following recommendations apply to both NFS and regular file systems.

        All user accounts should be placed in a parent directory that contains
only user directories. A suggested name is home" for the parent
user directory. 

        The user account parent directory should either be its own filesystem
separate from /usr" or a directory under /usr". The separation
of user accounts from other directories under /usr" makes administration
easier. For example, using the du -s *" command while in the
user account directory allows a disk usage summary report of your
users.

        If you have several systems on your network having different disk
configurations, UNIX provides a symbolic link feature that allows
you to set up the directory tree to appear the same on all systems.
A symbolic link is created by using the link command:

        ln -s <directory> <linkname>

        As an example, a 2 workstation network has system A with a single
disk (2 filesystems /" and /usr) and system B with two disks
( 3 filesystems /", /usr" and /home"). The administrator
places all user account directories in a directory called /home".
On system B, the second disk is mounted as the home directory. System
A, /home" is a symbolic link to /usr/home." A user logging
into system A sees his home directory path as /home/fred" even
though the directory physically exists on the /usr" filesystem.
On system A, the password entry for the user's home directory would
be /home/fred".

        A method for mounting NFS directories is to create a directory called
/nfs" and under it create subdirectories for each workstation
on the network with subdirectories for each remote filesystem. An
exception to this rule is when systems share the /usr" filesystem.

        Here a single disk contains the /usr" files and all other systems
on the network mount this filesystem as /usr". A network of workstations
set-up this way saves at least 20 megabytes
of diskspace per system for software and 25 megabytes
per system for shared Allegro software.

        If you decide to designate an NFS server for the /usr" filesystem
than you must insure that the /usr" server is reliable (also
users should not be able to reboot the system) and a procedure is
available for using another workstation as /usr" backup if the
main system goes down due to a hardware failure. Networks having 10
or more systems might consider using two /usr" servers and splitting
the load.

        You can also designate one workstation as the Allegro software server
and a second workstation as the /usr" server. In setting up a
/usr" server there are several files in /usr" that must
be made private (local). The technique and files for doing this are
discussed in the ULTRIX manuals.
