For information on installing the Network File System (NFS), see the AIX 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
If pound signs (#) appear at the beginning of the lines as shown, delete them.
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.
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 -aThe -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 dirnamewhere dirname is the full path name of the directory you just deleted from the /etc/exports file.
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.
exportfs -u /dirnamewhere dirname is the name of the file system you want to change.
smit chnfsexp
exportfs /dirnamewhere dirname is the name of the file system you just changed.
exportfs -u /dirnamewhere dirname is the name of the file system you want to change.
exportfs /dirnamewhere dirname is the name of the file system you just changed.
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.
To mount an NFS directory explicitly, use the Web-based System Manager fast path, wsm network, or use the following procedure:
showmount -e ServerNamewhere 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/directorywhere 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 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 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.
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.
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.
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.
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_mountThe following parameters are required for stanzas pertaining to NFS mounts:
When used between two systems, NFS supports access control lists. If the noacl option is used when mounting a file system, NFS does not use ACLs. The effect of the noacl option equals what happens when an NFS client on a system mounts from an NFS server that does not support ACLs.
For more information about ACLs, refer to "NFS Access Control List (ACL) Support".
Note: When you specify a hard mount, it is possible that the process can hang while waiting for a response. To be able to interrupt the process and end it from the keyboard, use the intr variable in the mount variables.
Note: The attribute cache retains file attributes on the client. Attributes for a file are assigned a time to be erased. If the file is modified before the flush time, then the flush time is extended by the time since the previous modification (under the assumption that recently changed files are likely to change again soon). There are minimum and maximum flush time extensions for regular files and for directories.
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.