There are no specific installation tasks needed for NFS as the Base Operating System (BOS) Installation also includes the default installation of network services, such as TCPIP and NFS.
Before starting the configuration of NFS on any of the systems, perform the following tasks:
smitty mknfs
# mknfs -N 0513-059 The portmap Subsystem has been started. Subsystem PID is 23734. Starting NFS services: 0513-059 The biod Subsystem has been started. Subsystem PID is 27264. 0513-059 The nfsd Subsystem has been started. Subsystem PID is 30570. 0513-059 The rpc.mountd Subsystem has been started. Subsystem PID is 28350. 0513-059 The rpc.statd Subsystem has been started. Subsystem PID is 15298. 0513-059 The rpc.lockd Subsystem has been started. Subsystem PID is 30976. #
Table 34 lists the most common
flags of the mknfs command.

Table 34: Flags for the mknfs Command
The -B and -l options place an entry in the inittab file so that the /etc/rc.nfs script is run each time the system restarts. This script, in turn, starts all NFS daemons required for a particular system.
For each system that is to be a server (CRoom and Accounts), use the following instructions to configure them as NFS Server:
The NFS daemons can be started individually or all at once. To start NFS daemons individually:
startsrc -s daemon
where daemon is any one of the SRC controlled daemons (See 11.4 NFS Files, Commands, and Daemons Reference). For example, to start the nfsd daemon:
startsrc -s nfsd
To start all of the NFS daemons:
startsrc -g nfs
| Note |
|---|
|
If the /etc/exports file does not exist, the nfsd and the rpc.mountd daemons will not be started. You can create an empty /etc/exports file by running the command touch /etc/exports. This will allow the nfsd and the rpc.mountd daemons to start although no file systems will be exported. |
This section discusses the use of the exportfs command.
In order to export file systems using SMIT, follow this procedure:
# lssrc -g nfs Subsystem Group PID Status biod nfs 15740 active nfsd nfs 11376 active rpc.mountd nfs 5614 active rpc.statd nfs 16772 active rpc.lockd nfs 15496 active #
/usr/sbin/exportfs -a
The -a option tells the exportfs command to send all information in the /etc/exports file to the kernel. If NFS is not running, start NFS using the instructions in 11.2 Planning, Installation, and Configuration of NFS.
For the CRoom Server:
# showmount -e CRoom export list for CRoom: /home1 (everyone) /home2 (everyone) /home3 (everyone) /home4 (everyone) #
For the Accounts Server:
# showmount -e Accounts export list for Accounts: /backup Marketing #
In order to export file systems using a text editor, follow this procedure:
vi /etc/exports
A file system can be exported when needed, and as such, does not change the /etc/exports file. This is done by entering:
exportfs -i /dirname
where dirname is the name of the file system you want to export. The exportfs -i command specifies that the /etc/exports file is not to be checked for the specified directory, and all options are taken directly from the command line.
For each system that is to be a client (HResources, Accounts, and Marketing), the following steps will ensure that they have access to directories and files on the CRoom and Accounts Servers.
%defaultvfs jfs nfs nfs 2 /sbin/helpers/nfsmnthelp none remote
If pound signs (#) appear at the beginning of the lines as shown, delete the pound signs.
You can unexport an NFS directory using one of the following procedures.
smitty rmnfsexp
The directory is now removed from the /etc/exports file and is unexported.
exportfs -u dirname
where dirname is the full path name of the directory(/home4) you just deleted from the /etc/exports file.
There are three types of NFS mounts: Predefined, explicit, and automatic.
Predefined mounts are specified in the
/etc/filesystems file. Each stanza (or entry) in this
file defines the characteristics of a mount as shown in
Figure 104. Data, such as the host name, remote path,
local path, and any mount options, are listed in this stanza. Predefined mounts
should be used when certain mounts are always required for proper operation of
a client.
/home1: dev = /dev/hd1 vol = "/home1" mount = true check = true free = false vfs = jfs log = /dev/hd8 |
Explicit mounts serve the needs of the root user. Explicit mounts are usually done for short periods of time when there is a requirement for occasional unplanned mounts. Explicit mounts can also be used if a mount is required for special tasks, and that mount should not be generally available on the NFS client. These mounts are usually fully qualified on the command line by using the mount command with all needed information.
Explicit mounts do not require updating the /etc/filesystems file. File systems mounted explicitly remain mounted unless explicitly unmounted with the umount command or until the system is restarted.
Automatic mounts are controlled by the automount command, which causes the AutoFS kernel extension to monitor specified directories for activity. If a program or user attempts to access a directory that is not currently mounted, then AutoFS intercepts the request, arranges for the mount of the file system, and then services the request.
Clients access files on the server by first mounting a server's exported directories. When a client mounts a directory, it does not make a copy of that directory. Rather, the mounting process uses a series of remote procedure calls to enable a client to access the directories on the server transparently. The following describes the mounting process:
Once the file system is mounted, the client can perform file operations. When the client does a file operation, the biod daemon sends the file handle to the server, where the file is read by one of the nfsd daemons to process the file request. Assuming the client has access to perform the requested file operation, the nfsd daemon returns the necessary information to the client's biod daemon.
The following procedure helps to complete the scenario shown in Figure 101.
mkdir /home1
This directory should be empty. This mount point can be created like any other directory, and no special attributes are needed for this directory.
| Note |
|---|
|
The mount points for all NFS mounts must exist on your system before you can mount a file system with one exception. If the automount daemon is used, it may not be necessary to create mount points. See 11.2.3.4 Mounting an NFS Automatically. |
You can establish predefined NFS mounts using one of the following procedures.
| Note |
|---|
|
Define the bg (background) and intr (interruptible) options in the /etc/filesystems file when establishing a predefined mount that is to be mounted during system startup. Mounts that are non-interruptible and running in the foreground can hang the client if the network or server is down when the client system starts up. If a client cannot access the network or server, the user must start the machine again in maintenance mode and edit the appropriate mount requests. |
To establish predefined mounts through SMIT (Figure 105), use the following command:
smitty mknfsmnt
Specify values in this screen for each mount you want predefined. You must specify a value for each required field (those marked with an asterisk (*) in the left margin). You may specify values for the other fields or accept their default values. This method creates an entry in the /etc/filesystems file for the desired mount and attempts the mount.
To establish the NFS default mounts by editing the /etc/filesystems file (only use this method under special circumstances), perform the following:
/home1: dev = /home1 mount = false vfs = nfs nodename = CRoom options = ro,soft type = nfs_mount
This stanza directs the system to mount the /home1 remote directory over the local mount point of the same name. The file system is mounted as read-only (ro). Because it is also mounted as soft, an error is returned in the event the server does not respond. By specifying the type parameter as nfs_mount, the system attempts to mount the /home1 file system (along with any other file systems that are specified in the type = nfs_mount group) when the mount -t nfs_mount command is issued.
The following example stanza directs the system to mount the /home2 file system at system startup time. If the mount fails, the system continues to attempt to mount in the background.
/home2: dev = /home2 mount = true vfs = nfs nodename = CRoom options = ro,soft,bg type = nfs_mount
| Note |
|---|
|
See 11.2.3.5 Parameters for additional parameters. |
The NFS is now ready to use.
To mount an NFS directory explicitly, use the following procedure:
showmount -e ServerName
For Server CRoom:
# showmount -e CRoom export list for CRoom: /home1 (everyone) /home2 (everyone) /home3 (everyone) /home4 (everyone) #
where ServerName is the name of the NFS server. This command displays the names of the directories currently exported from the NFS server. If the directory you want to mount is not listed, export the directory from the server.
smitty mknfsmnt
| Note |
|---|
|
If you are using the ASCII SMIT interface, press the Tab key to change to the correct value for each field, but do not press Enter until you get to step 7. |
The NFS is now ready to use.
AutoFS relies on the use of the automount command to propagate the automatic mount configuration information to the AutoFS kernel extension and start the automountd daemon. Through this configuration propagation, the extension automatically and transparently mounts file systems whenever a file or a directory within that file system is opened. The extension informs the automountd daemon of mount and unmount requests, and the automountd daemon actually performs the requested service.
Because the name-to-location binding is dynamic within the automountd daemon, updates to a Network Information Service (NIS) map used by the automountd daemon are transparent to the user. Also, there is no need to pre-mount shared file systems for applications that have hard-coded references to files and directories, nor is there a need to maintain records of which hosts must be mounted for particular applications.
AutoFS allows file systems to be mounted as needed. With this method of mounting directories, all file systems do not need to be mounted all of the time, only those being used are mounted.
For example, to mount the /backup NFS directory automatically:
# showmount -e Accounts export list for Accounts: /backup Marketing #
This command displays the names of the directories currently exported from the NFS server.
lssrc -s automountd
If the automountd subsystem is not running, issue: startsrc -s automountd
/usr/sbin/automount -v /backup /tmp/mount.map
where /backup is the AutoFS mount point on the client. Now, if a user runs the cd /backup command, the AutoFS kernel extension will intercept access to the directory and will issue a remote procedure call to the automountd daemon, which will mount the /backup directory and then allow the cd command to complete.
If, for some reason, the automountd daemon was started without the use of SRC, issue:
kill automountd_PID
where automountd_PID is the process ID of the automountd daemon. (Running the ps -e command will display the process ID of the automountd daemon.) The kill command sends a SIGTERM signal to the automountd daemon.
The parameters required for stanzas pertaining to NFS mounts are:
If you do not set the following options, the kernel automatically sets them to the following default values: