[ Bottom of Page | Previous Page | Next Page | 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.2 Installation Guide and Reference.
Checklist for Configuring NFS
Once the NFS software is installed on your systems,
you are ready to configure NFS.
- 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).
- For each system (whether client or server), follow the instructions in Start the NFS Daemons at System Startup.
- For each NFS server, follow the instructions in Configuring an NFS Server.
- For each NFS client, follow the instructions in Configuring an NFS Client.
- 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:
- Start NFS using the instructions in Start the
NFS Daemons Using SRC.
- Create the /etc/exports file.
Configuring an NFS Client
- 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 (#).
- Start NFS using the instructions in Start the
NFS Daemons.
- 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.
- 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.
- To unexport an NFS directory using SMIT:
- Type the following at a command prompt and press Enter:
smit rmnfsexp
- Enter the appropriate path name in the PATHNAME of exported directory
to be removed field.
The directory is now removed from
the /etc/exports file and is unexported.
- To unexport an NFS directory by using a text editor:
- Open the /etc/exports file with your favorite text
editor.
- Find the entry for the directory you wish to unexport, and the delete
that line.
- Save and close the /etc/exports file.
- If NFS is currently running, enter:
exportfs -u dirname
where dirname is the full path name of the directory you just deleted
from the /etc/exports file.
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.
- To change an exported NFS file system using SMIT:
- To unexport the file system, Enter:
exportfs -u /dirname
where dirname is the name of the file system
you want to change.
- Enter:
smit chnfsexp
- Enter the appropriate path name in the PATHNAME of exported directory
field.
- Make whatever changes you want.
- Exit SMIT.
- Re-export the file system by entering:
exportfs /dirname
where dirname is the name of the file system you just changed.
- To change an exported NFS file system by using a text editor:
- To unexport the file system, Enter:
exportfs -u /dirname
where dirname is the name of the file system
you want to change.
- Open the /etc/exports file with your favorite text
editor.
- Make whatever changes you want.
- Save and close the /etc/exports file.
- Re-export the file system by entering:
exportfs /dirname
where dirname is the name of the file system you just changed.
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:
- 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.
- 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.
- 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.
- On the client machine, enter the following SMIT fast path:
smit mknfsmnt
- 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.
- PATHNAME of mount point.
- PATHNAME of remote directory.
- HOST where remote directory resides.
- MOUNT now, add entry to /etc/filesystems or both?
- /etc/filesystems entry will mount the directory on system RESTART.
- MODE for this NFS file system.
- Change or use the default values for the remaining entries, depending
on your NFS configuration.
- When you finish making all the changes on this screen, SMIT mounts the
NFS file system.
- 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:
- 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.
- 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
- Ensure that the AutoFS kernel entension is loaded
and the automountd daemon is running. This can be accomplished
in two ways:
- Using SRC: Issue lssrc -s
automountd. If the automountd subsystem is not
running, issue startsrc -s automountd.
- 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.
- 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.
- To establish predefined mounts through SMIT:
- Enter:
smit mknfsmnt
- Specify values in this screen for each mount you want to predefine. Specify
a value for each required field (those marked with an asterisk (*) in the
left margin). Also 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:
- Open the /etc/filesystems file with a text editor.
- Add entries for each of the remote file systems to be mounted when the
system is started. For example:
/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:
dev=filesystem_name |
Specifies the path name of the remote file system being mounted. |
mount=[true|false] |
If true the NFS file system is mounted
when the system boots. If false, the NFS
file system is not be mounted when the system boots. |
nodename=hostname |
Specifies the host machine on which the remote file system resides. |
vfs=nfs |
Specifies that the virtual file system being mounted is an NFS file
system. |
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:
- biods=N
- Specifies the number of biod daemons to start. The default is 6. N is an integer.
- bg
- Specifies to try the mount again in the background if the first mount
attempt fails.
|
|
- fg
- Specifies to try the mount again in the foreground if the first mount
attempt fails.
- noacl
- Disables, for this mount only, the Access Control List (ACL) support
provided by the NFS journaled file system.
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.
|
|
- retry=n
- Sets the number of times to try the mount.
- rsize=n
- Sets the read buffer size to the number of bytes specified by n.
- wsize=n
- Sets the write buffer size to the number of bytes specified by n.
|
|
- timeo=n
- Sets the NFS time out to the tenths of a second specified by n. Use this variable to avoid situations that can occur in networks
where the server load can cause inadequate response time.
- retrans=n
- Sets the number of NFS retransmissions to the number specified by n.
- port=n
- Sets the server port to the number specified by n.
- soft
- Returns an error if the server does not respond.
|
|
- hard
- Continues to try the request until the server responds.
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.
- intr
- Allows keyboard interrupts on hard mounts.
- ro
- Sets the read-only variable.
|
|
- rw
- Sets the read-write variable. Use the hard
variable along with this variable to avoid error conditions that can conflict
with applications if a soft mount is attempted
as read-write. See NFS Problem Determination for information on hard- and soft-mounted problems.
- secure
- Specifies to use a more secure protocol for NFS transactions.
- actimeo=n
- Extends flush time by n seconds for
both regular files and directories.
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.
|
|
- acregmin=n
- Holds cached attributes for at least n seconds after file modification.
- acregmax=n
- Holds cached attributes for no more than n seconds after file modification.
- acdirmin=n
- Holds cached attributes for at least n seconds after directory update.
- acdirmax=n
- Holds cached attributes for no more than n seconds after directory update.
|
|
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=5
port=NFS_PORT
hard
secure=off
acregmin=3
acregmax=60
acdirmin=30
acdirmax=60 |
- Remove any directory entries that you do not want to mount automatically
at system startup.
- Save and close the file.
- Run the mount -a command to mount all the directories
specified in the /etc/filesystems file.
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.
- To remove a predefined NFS mount through SMIT:
- Enter:
smit rmnfsmnt
- To remove a predefined NFS mount by editing the /etc/filesystems file:
- Enter the command: umount /directory/to/unmount.
- Open the /etc/filesystems file with your favorite
editor.
- Find the entry for the directory you just unmounted, and then delete it.
- Save and close the file.
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]