System Administration Guide: Network Services
Previous Next

Setting Up NFS Services

This section describes some of the tasks that are necessary to do the following:

  • Start and stop the NFS server

  • Start and stop the automounter

  • Select a different version of NFS


Note - Starting in the Solaris 10 release, NFS version 4 is the default.


Table 5-3 Task Map for NFS Services

Task

Description

For Instructions

Start the NFS server

Steps to start the NFS service if it has not been started automatically.

How to Start the NFS Services

Stop the NFS server

Steps to stop the NFS service. Normally the service should not need to be stopped.

How to Stop the NFS Services

Start the automounter

Steps to start the automounter. This procedure is required when some of the automounter maps are changed.

How to Start the Automounter

Stop the automounter

Steps to stop the automounter. This procedure is required when some of the automounter maps are changed.

How to Stop the Automounter

Select a different version of NFS on the server

Steps to select a different version of NFS on the server. If you choose not to use NFS version 4, use this procedure.

How to Select Different Versions of NFS on a Server

Select a different version of NFS on the client

Steps to select a different version of NFS on the client by modifying the /etc/default/nfs file. If you choose not to use NFS version 4, use this procedure.

How to Select Different Versions of NFS on a Client by Modifying the /etc/default/nfs File

Alternate steps to select a different version of NFS on the client by using the command line. If you choose not to use NFS version 4, use this alternate procedure.

How to Use the Command Line to Select Different Versions of NFS on a Client

How to Start the NFS Services

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Enable the NFS service on the server.

    Type the following command.

    # svcadm enable network/nfs/server

    This command enables the NFS service.


    Note - Starting with the Solaris 9 release, the NFS server starts automatically when you boot the system. Additionally, any time after the system has been booted, the NFS service daemons can be automatically enabled by sharing the NFS file system. See How to Set Up Automatic File-System Sharing.


How to Stop the NFS Services

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Disable the NFS service on the server.

    Type the following command.

    # svcadm disable network/nfs/server

How to Start the Automounter

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Enable the autofs daemon.

    Type the following command:

    # svcadm enable system/filesystem/autofs

How to Stop the Automounter

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Disable the autofs daemon.

    Type the following command:

    # svcadm disable system/filesystem/autofs

How to Select Different Versions of NFS on a Server

If you choose not to use NFS version 4, use this procedure.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Edit the /etc/default/nfs file.

    For example, if you want the server to provide only version 3, set the values for both NFS_SERVER_VERSMAX and NFS_SERVER_VERSMIN to 3. For a list of keywords and their values, refer to Keywords for the /etc/default/nfs File.

    NFS_SERVER_VERSMAX=value
    NFS_SERVER_VERSMIN=value
    value

    Provide the version number.


    Note - By default, these lines are commented. Remember to remove the pound (#) sign, also.


  3. (Optional) If you want to disable server delegation, include this line in the /etc/default/nfs file.
    NFS_SERVER_DELEGATION=off

    Note - In NFS version 4, server delegation is enabled by default. For more information, see Delegation in NFS Version 4.


  4. (Optional) If you want to set a common domain for clients and servers, include this line in the /etc/default/nfs file.
    NFSMAPID_DOMAIN=my.comany.com
    my.comany.com

    Provide the common domain

    For more information, refer to nfsmapid Daemon.

  5. Check if the NFS service is running on the server.

    Type the following command:

    # svcs network/nfs/server

    This command reports whether the NFS server service is online or disabled.

  6. (Optional) If necessary, disable the NFS service.

    If you discovered from the previous step that the NFS service is online, type the following command to disable the service.

    # svcadm disable network/nfs/server

    Note - If you need to configure your NFS service, refer to How to Set Up Automatic File-System Sharing.


  7. Enable the NFS service.

    Type the following command to enable the service.

    # svcadm enable network/nfs/server
See Also

Version Negotiation in NFS

How to Select Different Versions of NFS on a Client by Modifying the /etc/default/nfs File

The following procedure shows you how to control which version of NFS is used on the client by modifying the /etc/default/nfs file. If you prefer to use the command line, refer to How to Use the Command Line to Select Different Versions of NFS on a Client.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Edit the /etc/default/nfs file.

    For example, if you want only version 3 on the client, set the values for both NFS_CLIENT_VERSMAX and NFS_CLIENT_VERSMIN to 3. For a list of keywords and their values, refer to Keywords for the /etc/default/nfs File.

    NFS_CLIENT_VERSMAX=value
    NFS_CLIENT_VERSMIN=value
    value

    Provide the version number.


    Note - By default, these lines are commented. Remember to remove the pound (#) sign, also.


  3. Mount NFS on the client.

    Type the following command:

    # mount server-name:/share-point /local-dir
    server-name

    Provide the name of the server.

    /share-point

    Provide the path of the remote directory to be shared.

    /local-dir

    Provide the path of the local mount point.

See Also

Version Negotiation in NFS

How to Use the Command Line to Select Different Versions of NFS on a Client

The following procedure shows you how to use the command line to control which version of NFS is used on a client for a particular mount. If you prefer to modify the /etc/default/nfs file, see How to Select Different Versions of NFS on a Client by Modifying the /etc/default/nfs File.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Mount the desired version of NFS on the client.

    Type the following command:

    # mount -o vers=value server-name:/share-point /local-dir
    value

    Provide the version number.

    server-name

    Provide the name of the server.

    /share-point

    Provide the path of the remote directory to be shared.

    /local-dir

    Provide the path of the local mount point.


    Note - This command uses the NFS protocol to mount the remote directory and overrides the client settings in the /etc/default/nfs file.


See Also

Version Negotiation in NFS

Previous Next