Go to main content

Managing Network File Systems in Oracle® Solaris 11.4

Exit Print View

Updated: August 2021
 
 

NFS Daemons

To support NFS activities, several daemons are started when a system goes into run level or multiuser mode. The mountd and nfsd daemons are run on systems that are servers. The automatic startup of the server daemons depends on the existence of at least one NFS share. To display the current list of NFS shares, run the share –F nfs command. To support NFS file locking, the lockd and statd daemons are run on NFS clients and servers. However, unlike previous versions of NFS, in NFS Version 4, the daemons lockd, statd, and nfslogd are not used.

This section describes the following daemons.

automountd Daemon

The automountd daemon handles the mounting and unmounting requests from the autofs service. The syntax of the command is as follows:

automountd [-Tnv] [-D name=value]
–T

Enables tracing.

–n

Disables browsing on all autofs nodes.

–v

Logs all status messages to the console.

–D name=value

Substitutes value for the automount map variable that is indicated by name.

The default value for the automount map is /etc/auto_master. Use the –T option for troubleshooting.

You can make the same specifications with the sharectl command that you would make on the command line. However, unlike the command-line options, the SMF repository preserves your specifications, through service restarts and system reboots, as well as system upgrades. You can set the following parameters for the automountd daemon.

automountd_verbose

Logs status messages to the console and is the equivalent of the –v argument for the automountd daemon. The default value is FALSE.

nobrowse

Turns browsing on or off for all autofs mount points and is the equivalent of the –n argument for automountd. The default value is FALSE.

trace

Expands each remote procedure call (RPC) and displays the expanded RPC on standard output. This keyword is the equivalent of the –T argument for automountd. The default value is 0. Values can range from 0 to 5.

environment

Permits you to assign different values to different environments. This keyword is the equivalent of the –D argument for automountd. The environment parameter can be used multiple times. However, you must use separate entries for each environment assignment.

lockd Daemon

The lockd daemon supports record-locking operations on NFS files. The lockd daemon manages RPC connections between the client and the server for the Network Lock Manager (NLM) protocol. The daemon is normally started without any options. You can use three options with this command. You can set these options either from the command line or by setting parameters using the sharectl command. For more information, see the lockd(8) man page.


Note -  The LOCKD_GRACE_PERIOD keyword and the –g option have been deprecated. The deprecated keyword is replaced with the new grace_period parameter. If both keywords are set, the value for grace_period overrides the value for LOCKD_GRACE_PERIOD.

Like LOCKD_GRACE_PERIOD, the grace_period=graceperiod parameter sets the number of seconds after a server reboot that the clients have to reclaim both NFS Version 3 locks, provided by NLM, and NFS Version 4 locks.

The lockd_retransmit_timeout=timeout parameter selects the number of seconds to wait before retransmitting a lock request to the remote server. This option affects the NFS client-side service. The default value for timeout is 5 seconds. Decreasing the timeout value can improve response time for NFS clients on a "noisy" network. However, this change can cause additional server load by increasing the frequency of lock requests. The same parameter can be used from the command line by starting the daemon with the –t timeout option.

The lockd_servers=number parameter specifies the maximum number of concurrent lockd requests. The default value is 1024.

The nthreads parameter specifies the maximum number of concurrent threads that the server can handle. All NFS clients that use UDP share a single connection with the NFS server. Under these conditions, you might have to increase the number of threads that are available for the UDP connection. A minimum calculation would be to allow two threads for each UDP client. However, this number is specific to the workload on the client, so two threads per client might not be sufficient. The disadvantage to using more threads is that when the threads are used, more memory is used on the NFS server. If the threads are never used, however, increasing nthreads has no effect. The same parameter can be used from the command line by starting the daemon with the –nthreads option.

mountd Daemon

The mountd daemon handles file system mount requests from remote systems and provides access control. The mountd daemon checks /etc/dfs/sharetab to determine which file systems are available for remote mounting and which systems are allowed to do the remote mounting. For more information, see the mountd(8) man page.

–v

Runs the command in verbose mode. Every time an NFS server determines the access that a client should be granted, a message is printed on the console. The information that is generated can be useful when trying to determine why a client cannot access a file system.

–r

Rejects all future mount requests from clients. This option does not affect clients that already have a file system mounted.

In addition to the command-line options, several SMF parameters can be used to configure the mountd daemon:

client_versmin

Sets the minimum version of the NFS protocol to be used by the NFS client. The default is 2. Other valid values are 3, 4, and 4.1. Refer to Setting Up the NFS Service.

client_versmax

Sets the maximum version of the NFS protocol to be used by the NFS client. The default is 4.1. Other valid values are 2, 3, and 4. Refer to Setting Up the NFS Service.

nfs4cbd Daemon

The nfs4cbd daemon, which is for the exclusive use of the NFS Version 4 client, manages the communication endpoints for the NFS Version 4 callback program. The daemon has no user-accessible interface. For more information, see the nfs4cbd(8) man page.

nfsd Daemon

The nfsd daemon handles client file system requests. You can use several options with this command. See the nfsd(8) man page for a complete listing. These options can either be used from the command line or by setting the appropriate SMF parameter with the sharectl command.

listen_backlog=length

Sets the length of the connection queue over connection-oriented transports for NFS and TCP. The default value is 32 entries. The same selection can be made from the command line by starting nfsd with the –l option.

max_connections=#-conn

Selects the maximum number of connections per connection-oriented transport. The default value for #-conn is unlimited. The same parameter can be used from the command line by starting the daemon with the –c #-conn option.

servers=nservers

Selects the maximum number of concurrent requests that a server can handle. The default value for nservers is 1024. The same selection can be made from the command line by starting nfsd with the –nservers option.

Unlike older versions of this daemon, nfsd does not spawn multiple copies to handle concurrent requests. Checking the process table with ps only shows one copy of the daemon running.

In addition, the following SMF parameters can be used to configure the mountd daemon. These parameters do not have command-line equivalents:

server_versmin

Sets the minimum version of the NFS protocol to be registered and offered by the server. The default is 2. Other valid values are 3, 4, and 4.1. Refer to Setting Up the NFS Service.

server_versmax

Sets the maximum version of the NFS protocol to be registered and offered by the server. The default is 4.1. Other valid values are 2, 3, and 4. Refer to Setting Up the NFS Service.

server_delegation

Controls whether the NFS Version 4 delegation feature is enabled for the server. If this feature is enabled, the server attempts to provide delegations to the NFS Version 4 client. By default, server delegation is enabled. To disable server delegation, see How to Select Different Versions of NFS on a Server. For more information, refer to Delegation in NFS Version 4.

nfslogd Daemon


Note -  NFS Version 4 does not use this daemon.

The nfslogd daemon provides operational logging. NFS operations that are logged against a server are based on the configuration options that are defined in /etc/default/nfslogd. When NFS server logging is enabled, records of all RPC operations on a selected file system are written to a buffer file by the kernel. Then nfslogd postprocesses these requests. The name service switch is used to help map UIDs to logins and IP addresses to host names. The number is recorded if no match can be found through the identified name services.

Mapping of file handles to path names is also handled by nfslogd. The daemon tracks these mappings in a file-handle-to-path mapping table. One mapping table exists for each tag that is identified in /etc/nfs/nfslogd. After post-processing, the records are written to ASCII log files.

nfsmapid Daemon

Version 4 of the NFS protocol (RFC3530) changed the way user or group identifiers (UID or GID) are exchanged between the client and server. The protocol requires that a file's owner and group attributes be exchanged between an NFS Version 4 client and an NFS Version 4 server as strings in the form at user@nfsv4-domain or group@nfsv4-domain, respectively.

For example, user known_user has a UID 123456 on an NFS Version 4 client whose fully qualified hostname is system.example.com. For the client to make requests to the NFS Version 4 server, the client must map the UID 123456 to known_user@example.com and then send this attribute to the NFS Version 4 server. After the server receives known_user@example.com from the client, the server maps the string to the local UID 123456, which is understood by the underlying file system. This functionality assumes that every UID and GID in the network is unique and that the NFS Version 4 domains on the client match the NFS Version 4 domains on the server.

The NFS Version 4 client and server are both capable of performing integer-to-string and string-to-integer conversions. For example, in response to a GETATTR operation, the NFS Version 4 server maps UIDs and GIDs obtained from the underlying file system into their respective string representation and sends this information to the client. Alternately, the client must also map UIDs and GIDs into string representations. For example, in response to the chown command, the client maps the new UID or GID to a string representation before sending a SETATTR operation to the server.

    Note, however, that the client and server respond differently to unrecognized strings:

  • If the user does not exist on the server, even within the same NFS Version 4 domain configuration, the server rejects the remote procedure call (RPC) and returns an error message to the client. This situation limits the operations that can be performed by the remote user.

  • If the user exists on both the client and server but they have mismatched domains, the server rejects the attribute modifying operations (such as SETATTR) that require the server to map the inbound user string to an integer value that the underlying file system can understand. For NFS Version 4 clients and servers to function properly, their NFS Version 4 domains, the portion of the string after the @ sign, should match.

  • If the NFS Version 4 client does not recognize a user or group name from the server, the client is unable to map the string to its unique ID, an integer value. Under such circumstances, the client maps the inbound user or group string to the nobody user. This mapping to nobody creates varied problems for different applications. With NFS Version 4, operations that modify file attributes will fail.

  • If the server does not recognize the given user or group name, even if the NFS Version 4 domains match, the server is unable to map the user or group name to its unique ID, an integer value. Under such circumstances, the server maps the inbound user or group name to the nobody user. To prevent such occurrences, administrators should avoid making special accounts that exist only on the NFS Version 4 client.

You can change the domain name for the clients and servers using the sharectl command with the nfsmapid_domain option. This option sets a common domain for clients and servers. It overrides the default behavior of using the local DNS domain name. For task information, refer to Setting Up the NFS Service.

Configuration Files and the nfsmapid Daemon

    The nfsmapid daemon uses the SMF configuration information found in svc:system/name-service/switch and in svc:/network/dns/client as follows:

  • nfsmapid uses standard C library functions to request password and group information from back-end name services. These name services are controlled by the settings in the svc:system/name-service/switch SMF service. Any changes to the service properties affect nfsmapid operations. For more information about the svc:system/name-service/switch SMF service, see the nsswitch.conf(5) man page.

  • To ensure that NFS Version 4 clients are capable of mounting file systems from different domains, nfsmapid relies on the configuration of the DNS TXT resource record (RR), _nfsv4idmapdomain. For more information about configuring the _nfsv4idmapdomain resource record, see nfsmapid and DNS TXT Records. Also, note the following:

    • The DNS TXT RR should be explicitly configured on the DNS server with the desired domain information.

    • The svc:system/name-service/switch SMF service should be configured to enable the resolver to find the DNS server and search the TXT records for client and server NFS Version 4 domains.

Precedence Rules

    For nfsmapid to work properly, NFS Version 4 clients and servers must have the same domain. To ensure matching NFS Version 4 domains, nfsmapid follows these strict precedence rules:

  1. The daemon first checks the SMF repository for a value that has been assigned to the nfsmapid_domain parameter. If a value is found, the assigned value takes precedence over any other settings. The assigned value is appended to the outbound attribute strings and is compared against inbound attribute strings. For procedural information, see Setting Up the NFS Service.


    Note -  The use of the NFSMAPID_DOMAIN setting is not scalable and is not recommended for large deployments.
  2. If no value has been assigned to nfsmapid_domain, then the daemon checks for a domain name from a DNS TXT RR. nfsmapid relies on directives in the /etc/resolv.conf file that are used by the set of routines in the resolver. The resolver searches through the configured DNS servers for the _nfsv4idmapdomain TXT RR. Note that the use of DNS TXT records is more scalable. For this reason, continued use of TXT records is much preferred over setting the parameter in the SMF repository.

  3. If no DNS TXT record is configured to provide a domain name, then the nfsmapid daemon uses the value specified by the domain or search directive in the /etc/resolv.conf file, with the directive specified last taking precedence.

    In the following example, both the domain and search directives are used. The nfsmapid daemon uses the first domain listed after the search directive, which is example.com.

    domain company.example.com
    search example.com corp.example.com
  4. If the /etc/resolv.conf file does not exist, nfsmapid obtains the NFS Version 4 domain name by following the behavior of the domainname command. Specifically, if the /etc/defaultdomain file exists, nfsmapid uses the contents of that file for the NFS Version 4 domain. If the /etc/defaultdomain file does not exist, nfsmapid uses the domain name that is provided by the network's configured naming service. For more information, see the domainname(8) man page.

nfsmapid and DNS TXT Records

The ubiquitous nature of DNS provides an efficient storage and distribution mechanism for the NFS Version 4 domain name. Additionally, because of the inherent scalability of DNS, the use of DNS TXT resource records is the preferred method for configuring the NFS Version 4 domain name for large deployments. You should configure the _nfsv4idmapdomain TXT record on enterprise-level DNS servers. Such configurations ensure that any NFS Version 4 client or server can find its NFS Version 4 domain by traversing the DNS tree.

The following example shows a preferred entry for enabling the DNS server to provide the NFS Version 4 domain name:

_nfsv4idmapdomain		IN		TXT			"corp.example"

In this example, the domain name to configure is the value that is enclosed in double quotes. Note that no ttl field is specified and that no domain is appended to _nfsv4idmapdomain, which is the value in the owner field. This configuration enables the TXT record to use the zone's ${ORIGIN} entry from the Start-Of-Authority (SOA) record. For example, at different levels of the domain namespace, the record could read as follows:

_nfsv4idmapdomain.subnet.example.com.    IN    TXT    "corp.example"
_nfsv4idmapdomain.example.com.           IN    TXT    "corp.example"

This configuration provides DNS clients with the added flexibility of using the resolv.conf file to search up the DNS tree hierarchy. See the resolv.conf(5) man page. This capability provides a higher probability of finding the TXT record. For even more flexibility, lower level DNS subdomains can define their own DNS TXT resource records (RRs). This capability enables lower level DNS subdomains to override the TXT record that is defined by the top level DNS domain.


Note -  The domain that is specified by the TXT record can be an arbitrary string that does not necessarily match the DNS domain for clients and servers that use NFS Version 4. You have the option of not sharing NFS Version 4 data with other DNS domains.

Checking for the NFS Version 4 Domain

Before assigning a value for your network's NFS Version 4 domain, check whether an NFS Version 4 domain has already been configured for your network. The following examples provide ways of identifying your network's NFS Version 4 domain.

  • To identify the NFS Version 4 domain from a DNS TXT RR, use either the nslookup or the dig command:

    The following example shows sample output for the nslookup command:

    # nslookup -q=txt _nfsv4idmapdomain
    Server:         10.255.255.255
    Address:        10.255.255.255#53
    
    _nfsv4idmapdomain.company.example.com text = "example.com"

    The following example shows sample output for the dig command:

    # dig +domain=company.example.com -t TXT _nfsv4idmapdomain
    ...
    ;; QUESTION SECTION:
    ;_nfsv4idmapdomain.company.example.com. IN    TXT
    
    ;; ANSWER SECTION:
    _nfsv4idmapdomain.company.example.com. 21600 IN TXT   "example.com"
    
    ;; AUTHORITY SECTION:
    ...

    For information about setting up a DNS TXT RR, see nfsmapid and DNS TXT Records.

  • If your network is not set up with a NFS Version 4 DNS TXT RR, use the following command to identify your NFS Version 4 domain from the DNS domain name:

    # egrep domain /etc/resolv.conf
    domain company.example.com
  • If the /etc/resolv.conf file is not configured to provide a DNS domain name for the client, use the following command to identify the domain from the network's NFS Version 4 domain configuration:

    # cat /system/volatile/nfs4_domain
    example.com
  • If you are using a different naming service, such as NIS, use the following command to identify the domain for the naming service configured for your network:

    # domainname
    it.company.example.com

Configuring the NFS Version 4 Default Domain

Configuring an NFS Version 4 Default Domain in the Oracle Solaris 11 Release

In the Oracle Solaris 11 release, set the default NFS domain version by typing the following command:

# sharectl set -p nfsmapid_domain=example.com nfs 

Note -  Because of the inherent ubiquitous and scalable nature of DNS, the use of DNS TXT records for configuring the domain of large NFS Version 4 deployments continues to be preferred and strongly encouraged. See nfsmapid and DNS TXT Records.
Configuring an NFS Version 4 Default Domain in the Oracle Solaris 10 Release

In the initial Oracle Solaris 10 release of NFS Version 4, if your network included multiple DNS domains but only had a single UID and GID namespace, all clients had to use one value for nfsmapid_domain. For sites that use DNS, nfsmapid resolves this issue by obtaining the domain name from the value that you assigned to _nfsv4idmapdomain. For more information, see nfsmapid and DNS TXT Records. If your network is not configured to use DNS, during the first system boot, the operating system uses the sysidconfig utility to provide the following prompts for an NFS Version 4 domain name:

This system is configured with NFS Version 4, which uses a 
domain name that is automatically derived from the system's 
name services. The derived domain name is sufficient for most 
configurations. In a few cases, mounts that cross different 
domains might cause files to be owned by nobody due to the 
lack of a common domain name.

Do you need to override the system's default NFS version 4 domain 
name (yes/no)? [no]

The default response is [no]. If you choose [no], you see the following message:

For more information about how the NFS Version 4 default domain name is 
derived and its impact, refer to the man pages for nfsmapid(8) and 
nfs(5), and the System Administration Guide: Network Services.

If you choose [yes], you see this prompt:

Enter the domain to be used as the NFS Version 4 domain name.
NFS Version 4 domain name []:

Note -  If a value for nfsmapid_domain exists in the SMF repository, the domain name that you provide overrides that value.

Additional Information About nfsmapid

reparsed Daemon

The reparsed daemon interprets the data associated with a reparse point. These points are used by DFS and NFS referrals on SMB and NFS file servers. This service is managed by SMF and should not be manually started.

statd Daemon


Note - NFS Version 4 does not use this daemon.

The statd daemon works with lockd to provide crash and recovery functions for the lock manager. The statd daemon tracks the clients that hold locks on an NFS server. If a server crashes, on rebooting, statd on the server contacts statd on the client. The client statd can then attempt to reclaim any locks on the server. The client statd also informs the server statd when a client has crashed so that the client's locks on the server can be cleared. This daemon has no options. For more information, see the statd(8) man page.

The statd daemon must be able to process numerous concurrent requests quickly. An insufficient number of available threads might result in incoming requests from unregistered clients stalling and preventing statd from processing further requests from such clients.

You can use the sharectl command to update the statd_servers SMF property value, which specifies the number of concurrent statd threads that can run on a server. The statd daemon reads the statd_servers property value at startup. The daemon uses the specified property value or the default value of 1024. A valid value is an integer of at least 1024.

When the statd daemon is unable to process more incoming requests due to the threads being exhausted, test the configuration by running a command such as rpcinfo -T tcp localhost status. If the command issues the Program program-name not available error, use the sharectl command to set the statd_servers property value to a larger number of threads. See the sharectl(8) man page.

Use the statd_servers property to temporarily work around problems where statd is unable to process incoming requests.

Note that when you specify a new statd_servers property value, syslog issues a message that shows the updated number of statd threads.