July 7, 2001  
 
 

2.1.7 NFS

The last service that we will configure on the server is the Network File System, or NFS. Essentially, NFS allows multiple computers on the network to share a part, or volume, of a server’s hard drive. The central use for NFS in our classroom will be a public user volume that all machines on the network will have access to. Also, we will use NFS to share key parts of the server volume to make software installation and updates easier; these are the /home, /tmp, and /usr/local volumes. Before you begin to configure NFS, be sure the portmap, mountd, and nfsd services are running like we did above for ypserv and portmap. Start them if they are not. Next, we will edit the /etc/exports file using pico. Here is an example of a /etc/exports file:

/home        102(rw) 103(rw) 104(rw)
/tmp         102(rw) 103(rw) 104(rw)
/usr/local   102(ro) 103(ro) 104(ro)

Listed first are the points that we will share with client machines. Listed next are the hostnames of each client that will be allowed to share that particular point along with its permissions in parentheses. “Rw” allows the client to read and write to that volume, while “ro” only allows a client to read the volume. You needn’t put the fully-qualified domain name since those were defined earlier in the /etc/hosts file. Enter all of your machines in this file, since you will be configuring them all in the same way. Once you have configured your /etc/exports file, issue the following command:

exportfs

This will update the NFS database and allow your updates to take effect immediately. Now, you must restart nfsd for your changes to be broadcast to the network:

/etc/rc.d/init.d/nfs restart

Once you have completed the above steps, it’s time to turn your attention toward configuring the workstations. Make sure you log out of your server with the logout command. You will need to use this command twice: once to end the su session, and once for your user account.

 
   
 
© 2001 by grlucas.com; all rights reserved