For information on installing the Network File System (NFS), see the AIX 5L Version 5.1 Installation Guide.
Once the NFS software is installed on your systems, you are ready to configure NFS.
#%defaultvfs jfs nfs #nfs 2 /sbin/helpers/nfsmnthelp none remote
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.
You can export an NFS file system using the Web-based System Manager Network application, or you can use one of the following procedures.
smit mknfsexp
/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 Start the NFS Daemons.
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.
You can unexport an NFS directory using the Web-based System Manager Network application, or you can use one of the following procedures.
smit 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 you just deleted from the /etc/exports file.
Change an exported NFS file system using the Web-based System Manager Network application, or use one of the following procedures.
exportfs -u /dirname
where dirname is the name of the file system you want to change.
smit chnfsexp
exportfs /dirname
where dirname is the name of the file system you just changed.
exportfs -u /dirname
where dirname is the name of the file system you want to change.
exportfs /dirname
where dirname is the name of the file system you just changed.
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.
To mount an NFS directory explicitly, use the Web-based System Manager, wsm, or use the following procedure:
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.
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.
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.
The NFS file system 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 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:
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.
dir1 -rw serve1:/usr/local/dir1 dir2 -rw serve1:/usr/local/dir2
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.
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.
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.
smit mknfsmnt
/home/jdoe: dev = /home/jdoe mount = false vfs = nfs nodename = mach2 options = ro,soft type = nfs_mount
This stanza directs the system to mount the /home/jdoe 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 /home/jdoe file (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 example stanza below directs the system to mount the /usr/games file system at system startup time. If the mount fails, the system continues to attempt to mount in the background.
/usr/games: dev = /usr/games mount = true vfs = nfs nodename = gameserver options = ro,soft,bg type = nfs_mount
The following parameters are required for stanzas pertaining to NFS
mounts:
The following parameters are optional for stanzas pertaining to NFS
mounts:
type=type_name | Defines the file system being mounted as part of the type_name mount group. This parameter is used with the mount -t command, which mounts groups of specified file systems at the same time. |
options=options | Specifies one or more of the following options parameters:
|
| |
| |
| |
| |
| |
| |
Note: If you do not set the following options, the kernel automatically sets them to these default values:biods=6 fg retry=10000 rsize=8192 wsize=8192 timeo=7 retrans=3 port=NFS_PORT hard secure=off acregmin=3 acregmax=60 acdirmin=30 acdirmax=60 |
To unmount an explicitly or automatically mounted NFS directory, enter:
umount /directory/to/unmount
You can remove a predefined NFS mount using the Web-based System Manager Network application, or you can use one of the following procedures.