~
CHAPTER 18: NETWORK FILE SYSTEM
(NFS) ~
Network File System (NFS) is the UNIX way of sharing files and applications across the
network. The NFS concept is somewhat similar to that of Windows NT’s disk sharing in
that it allows you to attach to a disk and work with it as if it were a local drive – a very
handy tool for sharing files or a large disk with coworkers.
The Mechanics of NDS
the share appears locally as the /home directory.
the client and the server. RPC technology provides a standard mechanism for any
RPC client to contact the server and find out to which service the calls should be
directed.
is located on the server.
NOTE: If a NFS server is rebooted, all clients will automatically continue their operations
with the server as soon as the server is back online.
Versions of NFS
NFS is not a static protocol. Standards committees has helped NFS evolve to take advantage
of new technologies as well as changes in usage patterns.
Today, the standards are up to version 3.0, with 4.0 in the works.
Enabling NFS
If you aren’t sure about your system, use the ksysv tools. It will show NFS as started in
runlevel 3 and 5.
======================================================================
linux18.html PAGE 2 2002/07/20
The Components of NFS
NFS under Linux is made up of five parts: (built into the Kernel):
the server.
quota manager.
the request.
Configuring NFS Servers
The second step is to start the NFS server processes that read the /etc/exports file and
follow the specifications.
The /etc/exports Configuration File
NFS servers have only one configuration file: /etc/exports. This file lists the partitions that
are sharable, the hosts they can be shared with, and with what permissions. See page 418-420
Configuring NFS Clients
NFS clients are remarkably easy to configure under Linux, because they don’t require
any new or additional software to be loaded.
The only requirement is that the kernel be compiled to support NFS. All of the distributions
come with this feature enabled by default. Aside form the kernel, the only other change is
to the options in the mount command.
The
The mount options can also be used in the /etc/fstab file. This same entry in the /etc/fstab
file would look like this: See page 421
Soft vs. Hard Mounts
By default, NFS operations are hard, which means they continue their attempts to contact
the server indefinitely. This arrangement is not always beneficial, however. It causes a
problem if an emergency shutdown of all systems is performed.
======================================================================
linux18.html PAGE 3 2002/07/19
Enabling a soft mount allows the client to time out the connection after a number of retries
(specified with the retrans=r option).
Cross-Mounting Disks
Cross-mounting is the process of having server A NFS mounting server B’s disks, and server
B NFS mounting server A’s disks. In general, unless you have reason not to use the intr option,
it is usually a good idea to do so.
Performance Tuning
The default block size that gets transmitted with NFS is 1K. This is handy, since it fits nicely into
one packet and, should any packets get dropped, NFS has to retransmit very few packets. The
downside to this is that it doesn’t take advantage of the fact that most networking stacks are fast
enough to keep up with segmenting larger blocks of data for transport, and that most networks
are reliable enough that it is extremely rare to lose a block of data.
Common Uses for NFS Partitions
Hard vs. Soft Mounts
before allowing other operations. The client will continue trying to contact the server, until
the server sends back an acknowledgement.
server’s disk. The client will try to access the server and commit unwritten data, but after a
specified timeout period (number of retries), the client will give up and return control to the
user. Although this has the potential of causing data loss, it allows clients to handle failed
NFS servers more gracefully.
======================================================================
linux18.html PAGE 4 2002/07/19
Summary:
server; thus recovery is automatic when the server comes back up.
meet your system’s resource-sharing needs.