Page 457 - DCAP103_Principle of operating system
P. 457
Principles of Operating Systems
Notes 14.6.8 NFS—The Network File System
Networking has played a major role in Linux, and UNIX in general, right from the beginning
(the first UNIX network was built to move new kernels from the PDP-11/70 to the Interdata
8/32 during the port to the later). In this section, we will examine Sun Microsystem’s NFS
(Network File System), which is used on all modern Linux systems to join the file systems on
separate computers into one logical whole. Currently, the most dominant NSF implementation is
version 3, introduced in 1994 (Pawloski et al, 1994). NSFv4 was introduced in 2000 and provides
several enhancements over the previous NFS architecture. Three aspects of NFS are of interest:
the architecture, the protocol, and the implementation. We will now examine these in turn,
first in the context of the simpler NFS version 3, then we will briefly discuss the enhancements
included in v4.
14.6.8.1 NFS Architecture
The basic idea behind NFS is to allow an arbitrary collection of clients and servers to share a
common file system. In many cases, all the clients and servers are on the same LAN, but this
is not required. It is also possible to run NFS over a wide area network if the server is far from
the client. For simplicity we will speak of clients and servers as though they were on distinct
machines, but in fact, NFS allows every machine to be both a client and a server at the same
time. Each NFS server exports one or more of its directories for access by remote clients. When
a directory is made available, so are all of its subdirectories, so in fact, entire directory trees
are normally exported as a unit. The list of directories a server exports is maintained in a file,
often /etc/exports, so these directories can be exported automatically whenever the server is
booted. Clients access exported directories by mounting them. When a client mounts a (remote)
directory, it becomes part of its directory hierarchy, as shown in Figure 14.35.
Figure 14.35: Examples of Remote Mounted File Systems. Directories are Shown
as Squares and Files are shown as Circles
Client 1 Client 2
/ /
/bin /usr /bin /mnt
/usr/ ast
Mount
/usr/ ast/ work
/bin /projects
/proj 1 /proj 2
cat cp Is mv sh
a b c d e
Server 1 Server 2
450 LOVELY PROFESSIONAL UNIVERSITY