[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 System Management Guide: Communications and Networks

NFS Installation and Configuration

For information on installing the Network File System (NFS), see the AIX Installation Guide.

Checklist for Configuring NFS

Once the NFS software is installed on your systems, you are ready to configure NFS.

  1. Determine which systems in the network will be servers and which will be clients (a system can be configured as both a server and a client).
  2. For each system (whether client or server), follow the instructions in "Start the NFS Daemons at System Startup".
  3. For each NFS server, follow the instructions in "Configuring an NFS Server".
  4. For each NFS client, follow the instructions in "Configuring an NFS Client".
  5. If you want personal computers on your network to have access to your NFS servers (beyond being able to mount file systems), configure PC-NFS by following the instructions in "PC-NFS".

Configuring an NFS Server

To configure an NFS server:

  1. Start NFS using the instructions in "Start the NFS Daemons Using SRC".
  2. Create the /etc/exports file.

Configuring an NFS Client

  1. Verify that NFS is the default remote file system. (If this is not done, you will need to specify the -v nfs flag when using the mount command.) Using a text editor, open the /etc/vfs file and search for the following entry:
    #%defaultvfs jfs nfs
    #nfs 2 /sbin/helpers/nfsmnthelp none remote

    If pound signs (#) appear at the beginning of the lines as shown, delete them.

  2. Start NFS using the instructions in "Start the NFS Daemons".
  3. Establish the local mount point using the mkdir command. For NFS to complete a mount successfully, a directory that acts as the mount point (or place holder) of an NFS mount must be present. 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 the automount documentation for details.
  4. Establish and mount the predefined mounts by following the instructions in "Establishing Predefined NFS Mounts".

Exporting an NFS File System

You can export an NFS file system using the Web-based System Manager Network application, or you can use one of the following procedures.

Unexporting an NFS File System

You can unexport an NFS directory using the Web-based System Manager Network application, or you can use one of the following procedures.

Changing an Exported File System

You can change an exported NFS file system using the Web-based System Manager Network application, or you can use one of the following procedures.

Enabling Root User Access to an Exported File System

When you export a file system, you can enable the root user on a particular machine to have root access to that file system. By default, the root user is not granted root access to exported file systems. When a person logged in as the root user on one host requests access to a particular file from NFS, the user ID of the requester is mapped by NFS to the user ID of user nobody (nobody is one of the user names placed in the /etc/password file by default). The access rights of user nobody are the same as those given to the public (others) for a particular file. For example, if others only execute permission for a file, then user nobody can only execute the file.

To enable root user access to an exported file system, follow the instructions in "Changing an Exported File System". If you use the Web-based System Manager or SMIT method, specify in the HOSTS allowed root access field the name of the host to which you want to grant root access. If you edit the file with a text editor, add the qualifier -root=hostname to the file system entry. For example,

/usr/tps -root=hermes

specifies that the root user on host hermes may access the /usr/tps directory with root privileges.

Mounting an NFS File System Explicitly

To mount an NFS directory explicitly, use the Web-based System Manager fast path, wsm network, or use the following procedure:

  1. Verify that the NFS server has exported the directory:
    showmount -e ServerName
    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.
  2. Establish the local mount point using the mkdir command. For NFS to complete a mount successfully, a directory that acts as the mount point (or place holder) of an NFS mount must be present. This directory should be empty. This mount point can be created like any other directory, and no special attributes are needed for this directory.
  3. Enter:
    mount ServerName:/remote/directory /local/directory
    where ServerName is the name of the NFS server, /remote/directory is the directory on the NFS server you want to mount, and /local/directory is the mount point on the NFS client.
  4. On the client machine, enter the following SMIT fast path:

    smit mknfsmnt

  5. Make changes to the following fields that are appropriate for your network configuration. Your configuration may not require completing all of the entries on this screen.
    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.
  6. Use the default values for the remaining entries or change them, depending on your NFS configuration.
  7. When you finish making all the changes on this screen, SMIT mounts the NFS file system.
  8. When the Command: field shows the OK status, exit SMIT.

The NFS file system is now ready to use.

Automatic Mounting of a File System Using AutoFS

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 autmountd daemon of mount and unmount requests, and the autmountd daemon actually performs the requested service.

Because the name-to-location binding is dynamic within the autmountd daemon, updates to a Network Information Service (NIS) map used by the autmountd daemon are transparent to the user. Also, there is no need to premount 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 an NFS directory automatically:

  1. Verify that the NFS server has exported the directory by entering:
    showmount -e ServerName

    where ServerName is the name of the NFS server. This command displays the names of the directories currently exported from the NFS server.

  2. Create an AutoFS map file. AutoFS will mount and unmount the directories specified in this map file. For example, suppose you want to use AutoFS to mount the /usr/local/dir1 and /usr/local/dir2 directories as needed from the serve1 server onto the /usr/remote/dir1 and /usr/remote/dir2 directories, respectively. In this example, the map file name is /tmp/mount.map .
  3. Ensure that the AutoFS kernel entension is loaded and the automountd daemon is running. This can be accomplished in two ways:
    1. Using SRC: Issue lssrc -s automountd. If the automountd subsystem is not running, issue startsrc -s automountd.
    2. Using the automount command: Issue /usr/bin/automount -v.

    Define the map file using the command line interface by entering:

    /usr/sbin.automount  /usr/remote  /tmp/mount.map

    where /usr/remote is the AutoFS mount point on the client. Now, if a user runs the cd /usr/remote/dir1 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 /usr/remote/dir1 directory and then allow the cd command to complete.

  4. To stop the automount daemon, issue the stopsrc -s automountd command.

    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.

Establishing Predefined NFS Mounts

You can establish predefined NFS mounts using the Web-based System Manager Network application, or you can use one of the following procedures.

Attention: Define the bg (background) and intr (interruptible) options in the /etc/filesystems file when establishing a predefined mount that will be mounted during system startup. Mounts that are noninterruptible 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.

Unmounting an Explicitly or Automatically Mounted File System

To unmount an explicitly or automatically mounted NFS directory, enter:

umount /directory/to/unmount

Removing Predefined NFS Mounts

You can remove a predefined NFS mount using the Web-based System Manager Network application, or you can use one of the following procedures.


[ Previous | Next | Contents | Glossary | Home | Search ]