System information

Chapter 9. Network File System (NFS)
A Network File System (NFS) allows remote hosts to mount file systems over a network and interact
with those file systems as though they are mounted locally. This enables system administrators to
consolidate resources onto centralized servers on the network.
This chapter focuses on fundamental NFS concepts and supplemental information.
9.1. How NFS Works
Currently, there are three versions of NFS. NFS version 2 (NFSv2) is older and widely supported.
NFS version 3 (NFSv3) supports safe asynchronous writes and is more robust at error handling than
NFSv2; it also supports 64-bit file sizes and offsets, allowing clients to access more than 2Gb of file
data.
NFS version 4 (NFSv4) works through firewalls and on the Internet, no longer requires an rpcbi nd
service, supports ACLs, and utilizes stateful operations. Red Hat Enterprise Linux 6 supports NFSv2,
NFSv3, and NFSv4 clients. When mounting a file system via NFS, Red Hat Enterprise Linux uses
NFSv4 by default, if the server supports it.
All versions of NFS can use Transmission Control Protocol (TCP) running over an IP network, with
NFSv4 requiring it. NFSv2 and NFSv3 can use the User Datagram Protocol (UDP) running over an IP
network to provide a stateless network connection between the client and server.
When using NFSv2 or NFSv3 with UDP, the stateless UDP connection (under normal conditions)
has less protocol overhead than TCP. This can translate into better performance on very clean, non-
congested networks. However, because UDP is stateless, if the server goes down unexpectedly, UDP
clients continue to saturate the network with requests for the server. In addition, when a frame is lost
with UDP, the entire RPC request must be retransmitted; with TCP, only the lost frame needs to be
resent. For these reasons, TCP is the preferred protocol when connecting to an NFS server.
The mounting and locking protocols have been incorporated into the NFSv4 protocol. The server
also listens on the well-known TCP port 2049. As such, NFSv4 does not need to interact with
rpcbi nd , l o ckd , and rpc. statd daemons. The rpc. mo untd daemon is required on the NFS
server to set up the exports.
Note
TCP is the default transport protocol for NFS version 2 and 3 under Red Hat Enterprise Linux.
UDP can be used for compatibility purposes as needed, but is not recommended for wide
usage. NFSv4 requires TCP.
All the RPC/NFS daemons have a ' -p' command line option that can set the port, making
firewall configuration easier.
After TCP wrappers grant access to the client, the NFS server refers to the /etc/expo rts
configuration file to determine whether the client is allowed to access any exported file systems. Once
verified, all file and directory operations are available to the user.
[3]
Red Hat Ent erprise Lin ux 6 St orage Admin ist rat io n G uide
50