[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

System Management Guide: Communications and Networks


NFS Installation and Configuration

For information on installing the Network File System (NFS), see the AIX 5L Version 5.1 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 are to be servers and which are to 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, 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
    

    Delete any lines that begin with a pound sign (#).

  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.

    Note:With one exception, the mount points for all NFS mounts must exist on your system before mounting a file system. If the automount daemon is used, it might 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

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

Enabling Root User Access to an Exported File System

When a file system is exported, by default, the root user is not granted root access to that exported file systems. When a 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 has run permission for a file, then user nobody can only run 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, wsm, 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. A null (empty) directory that acts as the mount point (or place holder) of an NFS mount must be present for NFS to complete a mount successfully. This mount point can be created like any other directory, and no special attributes are needed.
  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 might not require completing all of the entries on this screen.

    Note: If the ASCII SMIT interface is being used, press the Tab key to change to the correct value for each field, but do not press Enter until completing step 7.

  6. Change or use the default values for the remaining entries, 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.

Using AutoFS to Automatically Mount a File System

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 mounts and unmounts 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.

    dir1            -rw              serve1:/usr/local/dir1
    dir2            -rw              serve1:/usr/local/dir2
    
  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. If a user runs the cd /usr/remote/dir1 command, the AutoFS kernel extension intercepts access to the directory and issues a remote procedure call to the automountd daemon, which mounts the /usr/remote/dir1 directory and then allows the cd command to complete.

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

    where /usr/remote is the mount point on the NFS client. If a user runs the cd /usr/remote/dir1 command, the automount daemon mounts the /usr/remote/dir1 directory and then allows 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 displays 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 is 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 | Table of Contents | Index | Library Home | Legal | Search ]