Remote File-System Administration (Tasks)
This chapter provides information on how to perform such NFS administration tasks as setting up NFS services, adding new file systems to share, and mounting file system. The chapter also covers the use of the Secure NFS system, and the use of WebNFS functionality. The last part of the chapter includes troubleshooting procedures and a list of some of the NFS error messages and their meanings.
Your responsibilities as an NFS administrator depend on your site's requirements and the role of your computer on the network. You might be responsible for all the computers on your local network, in which instance you might be responsible for determining these configuration items:
Which computers, if any, should be dedicated servers
Which computers should act as both servers and clients
Which computers should be clients only
Maintaining a server after it has been set up involves the following tasks:
Sharing and unsharing file systems as necessary
Modifying administrative files to update the lists of file systems your computer shares or mounts automatically
Checking the status of the network
Diagnosing and fixing NFS-related problems as they arise
Setting up maps for autofs
Remember, a computer can be both a server and a client--sharing local file systems with remote computers and mounting remote file systems.
Automatic File-System Sharing
Entries in the /etc/dfs/dfstab file are shared automatically whenever you start NFS server operation. You should set up automatic sharing if you need to share the same set of file systems on a regular basis. For example, if your computer is a server that supports home directories, you need to make the home directories available at all times. Most file-system sharing should be done automatically. The only time that manual sharing should occur is during testing or troubleshooting.
The dfstab file lists all the file systems that your server shares with its clients. This file also controls which clients can mount a file system. You can modify dfstab to add or delete a file system or change the way sharing is done. Just edit the file with any text editor that is supported (such as vi). The next time the computer enters run level 3, the system reads the updated dfstab to determine which file systems should be shared automatically.
Table 15-1 File-System Sharing Task Map
Establish automatic file-system sharing
|Steps to configure a server so that file systems are automatically shared when the server is rebooted||"How to Set Up Automatic File-System Sharing"|
|Steps to configure a server so that users can access files by using WebNFS||"How to Enable WebNFS Access"|
Enable NFS server logging
|Steps to configure a server so that NFS logging is run on selected file systems||"How to Enable NFS Server Logging"|
How to Set Up Automatic File-System Sharing
Become superuser or assume an equivalent role.
Add entries for each file system to be shared.
share [-F nfs] [-o specific-options] [-d description] pathname
See the dfstab(4) man page for a description of /etc/dfs/dfstab and the share_nfs(1M) man page for a complete list of options.
Check if the NFS service is running on the server.
If this is the first share command or set of share commands that you have initiated, the NFS service might not be running. Check that one of the NFS daemons is running by using the following command.
# pgrep nfsd 318
318 is the process ID for nfsd in this example. If a ID is not displayed, it means that the service is not running. The second daemon to check for is mountd.
Start the NFS service.
If the previous step does not report a process ID for nfsd, start the NFS service by using the following command.
# /etc/init.d/nfs.server start
Share the file system.
After the entry is in /etc/dfs/dfstab, the file system can be shared by either rebooting the system or by using the shareall command. If the NFS service was started earlier, this command does not need to be run because the init script runs the command.
Verify that the information is correct.
Run the share command to check that the correct options are listed:
# share - /export/share/man ro "" - /usr/src rw=eng "" - /export/ftp ro,public ""