Installation guide

Chapter 10.
Network File System (NFS)
Network File System (NFS) is a way to share files between machines on a network as if the
files were located on the client’s local hard drive. Red Hat Linux can be both an NFS server
and an NFS client, which means that it can export filesystems to other systems and mount
filesystems exported from other machines.
10.1. Why Use NFS?
NFS is useful for sharing directories of files between multiple users on the same network.
For example, a group of users working on the same project can have access to the files for
that project using a shared directory of the NFS filesystem (commonly known as an NFS
share) mounted in the directory /myproject. To access the shared files, the user goes into the
/myproject directory on his machine. There are no passwords to enter or special commands
to remember. Users work as if the directory is on their local machines.
10.2. Mounting NFS Filesystems
Use the mount command to mount an NFS filesystem from another machine:
mount shadowman.example.com:/misc/export /misc/local
Warning
The mount point directory on local machine (/misc/local in the above example) must exist.
In this command, shadowman.example.com is the hostname of the NFS fileserver,
/misc/export is the filesystem that shadowman is exporting, and /misc/local is the
location to mount the filesystem on the local machine. After the mount command runs (and
if the client has proper permissions from the shadowman.example.com NFS server) the
client user can execute the command ls /misc/local to display a listing of the files in
/misc/export on shadowman.example.com.
10.2.1. Mounting NFS Filesystems 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. After adding this line to /etc/fstab
on the client system, type the command mount /pub at a shell prompt, and the mount point
/pub will be mounted from the server.