Where to Go From Here
The next step is to set up your autofs maps so that clients can access the file systems you have shared on the server. See "Autofs Administration Task Overview".
How to Enable WebNFS Access
Starting with the 2.6 release, by default all file systems that are available for NFS mounting are automatically available for WebNFS access. The only condition that requires the use of this procedure is one of the following:
To allow NFS mounting on a server does not already allow it
To reset the public file handle to shorten NFS URLs by using the public option
To force the loading of a specific html file by using the index option
See "Planning for WebNFS Access" for a list of issues that you should consider before starting the WebNFS service.
Become superuser or assume an equivalent role.
For information about roles, see "Using Privileged Applications" in System Administration Guide: Security Services.
Add entries for each file system to be shared by using the WebNFS service.
Edit /etc/dfs/dfstab and add one entry to the file for each file system. The public and index tag that are shown in the following example are optional.
share -F nfs -o ro,public,index=index.html /export/ftp
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 daemons might not be running. Check to see 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 an ID is not displayed, it means that the service is not running. The second daemon to check for is mountd.
- (Optional)
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
This command ensures that NFS service is now running on the servers and restarts automatically when the server is at run level 3 during boot.
- (Optional)
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 script runs the command.
# shareall
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,index=index.html ""
How to Enable NFS Server Logging
Become superuser or assume an equivalent role.
For information about roles, see "Using Privileged Applications" in System Administration Guide: Security Services.
Optional: Change file system configuration settings.
In /etc/nfs/nfslog.conf, you can either edit the default settings for all file systems by changing the data associated with the global tag or you can add a new tag for this file system. If these changes are not needed, you do not need to change this file. The format of /etc/nfs/nfslog.conf is described in nfslog.conf(4).
Add entries for each file system to be shared by using NFS server logging.
Edit /etc/dfs/dfstab and add one entry to the file for the file system on which you are enabling NFS server logging. The tag that is used with the log=tag option must be entered in /etc/nfs/nfslog.conf. This example uses the default settings in the global tag.
share -F nfs -o ro,log=global /export/ftp
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 daemons 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.
- (Optional)
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
This command ensures that NFS service is now running on the servers and restarts automatically when the server is at run level 3 during boot.
- (Optional)
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 script runs the command.
# shareall
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,log=global ""
- (Optional)
Start the NFS log daemon, nfslogd, if it is not running already.
Restarting the NFS daemons by using the nfs.server script starts the daemon if the nfslog.conf file exists. Otherwise, the command needs to be run once by hand to create the files so that the command automatically restarts when the server is rebooted.
# /usr/lib/nfs/nfslogd
Mounting File Systems
You can mount file systems in several ways. They can be mounted automatically when the system is booted, on demand from the command line, or through the automounter. The automounter provides many advantages to mounting at boot time or mounting from the command line, but many situations require a combination of all three methods. In addition to these three ways of mounting a file system, several ways of enabling or disabling processes exist, depending on the options you use when mounting the file system. See the following table for a complete list of the tasks that are associated with file system mounting.
Table 15-2 Mounting File Systems Task Map
Task | Description | For Instructions |
---|---|---|
Mount a file system at boot time | Steps so that a file system is mounted whenever a system is rebooted. | "How to Mount a File System at Boot Time" |
Mount a file system by using a command | Steps to mount a file system when a system is running. This procedure is useful when testing. | "How to Mount a File System From the Command Line" |
Mount with the automounter | Steps to access a file system on demand without using the command line. | "Mounting With the Automounter" |
Prevent large files | Steps to prevent large files from being created on a file system. | "How to Disable Large Files on an NFS Server" |
Start client-side failover | Steps to enable the automatic switchover to a working file system if a server fails. | "How to Use Client-Side Failover" |
Disable mount access for a client | Steps to disable the ability of one client to access a remote file system. | "How to Disable Mount Access for One Client" |
Provide access to a file system through a firewall | Steps to allow access to a file system through a firewall by using the WebNFS protocol. | "How to Mount an NFS File System Through a Firewall" |
Mount a file system by using a NFS URL | Steps to allow access to a file system using an NFS URL. This process allows for file-system access without using the MOUNT protocol. | "How to Mount an NFS File System Using an NFS URL" |