Installation guide

Chapter 10. Network File System (NFS)
60
If an NFS share was mounted manually, the share will not be automatically mounted upon reboot. Red
Hat Enterprise Linux offers two methods for mounting remote file systems automatically at boot time:
the /etc/fstab file and the autofs service. Refer to Section 10.2.1, “Mounting NFS File Systems
using /etc/fstab and Section 10.3, “autofs for more information.
10.2.1. Mounting NFS File Systems using /etc/fstab
An alternate way to mount an NFS share from another machine is to add a line to the /etc/fstab
file. The line must state the hostname of the NFS server, the directory on the server being exported,
and the directory on the local machine where the NFS share is to be mounted. You must be root to
modify the /etc/fstab file.
The general syntax for the line in /etc/fstab is as follows:
server:/usr/local/pub /pub nfs rsize=8192,wsize=8192,timeo=14,intr
The mount point /pub must exist on the client machine before this command can be executed. After
adding this line to /etc/fstab on the client system, use the command mount /pub, and the mount
point /pub is mounted from the server.
The /etc/fstab file is referenced by the netfs service at boot time, so lines referencing NFS
shares have the same effect as manually typing the mount command during the boot process.
A valid /etc/fstab entry to mount an NFS export should contain the following information:
server:/remote/export /local/directory nfs options 0 0
The variables server, /remote/export, /local/directory, and options are the same ones
used when manually mounting an NFS share. Refer to Section 10.2, “NFS Client Configuration” for a
definition of each variable.
Note
The mount point /local/directory must exist on the client before /etc/fstab is read.
Otherwise, the mount will fail.
For more information about /etc/fstab, refer to man fstab.
10.3. autofs
One drawback to using /etc/fstab is that, regardless of how infrequently a user accesses the NFS
mounted file system, the system must dedicate resources to keep the mounted file system in place.
This is not a problem with one or two mounts, but when the system is maintaining mounts to many
systems at one time, overall system performance can be affected. An alternative to /etc/fstab is to
use the kernel-based automount utility. An automounter consists of two components:
a kernel module that implements a file system
a user-space daemon that performs all of the other functions
The automount utility can mount and unmount NFS file systems automatically (on-demand
mounting), therefore saving system resources. It can be used to mount other file systems including
AFS, SMBFS, CIFS, and local file systems.