System Administration Guide: Resource Management and Network Services

How to Set Up Automatic File-System Sharing

  1. Become superuser or assume an equivalent role.

    For information about roles, see “Using Privileged Applications” in System Administration Guide: Security Services.

  2. Add entries for each file system to be shared.

    Edit /etc/dfs/dfstab. Add one entry to the file for every file system that you want to be automatically shared. Each entry must be on a line by itself in the file and use this syntax:


    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.

  3. 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 an ID is not displayed, then the service is not running. The second daemon to check for is mountd.

  4. (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.

  5. (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 init script runs the command.


    # shareall
    
  6. 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  ""

Where to Go From Here

The next step is to set up your autofs maps so that clients can access the file systems that you have shared on the server. See Task Overview for Autofs Administration.