Red Hat Enterprise Linux uses a combination of kernel-level support and daemon processes to provide NFS file sharing. NFS relies on Remote Procedure Calls (RPC) to route requests between clients and servers. RPC services under Linux are controlled by the portmap service.To share or mount NFS file systems, the following services work together:
The following RPC processes work together behind the scenes to facilitate NFS services:
- nfs - Starts the appropriate RPC processes to service requests for shared NFS file systems.
- nfslock - An optional service that starts the appropriate RPC processes to allow NFS clients to lock files on the server.
- portmap - The RPC service for Linux; it responds to requests for RPC services and sets up connections to the requested RPC service.
- rpc.mountd - This process receives mount requests from NFS clients and verifies the requested file system is currently exported. This process is started automatically by the nfs service and does not require user configuration.
- rpc.nfsd - This process is the NFS server. It works with the Linux kernel to meet the dynamic demands of NFS clients, such as providing server threads each time an NFS client connects. This process corresponds to the nfs service.
- rpc.lockd - An optional process that allows NFS clients to lock files on the server. This process corresponds to the nfslock service.
- rpc.statd - This process implements the Network Status Monitor (NSM) RPC protocol which notifies NFS clients when an NFS server is restarted without being gracefully brought down. This process is started automatically by the nfslock service and does not require user configuration.
- rpc.rquotad - This process provides user quota information for remote users. This process is started automatically by the nfs service and does not require user configuration.
To run an nfs server, the portmap service must be running. To verify that portmap is active, type the following command as root:
/sbin/service portmap status
If the portmap service is running, then the nfs service can be started. To start an nfs server, as root type:
/sbin/service nfs start
To stop the server, as root type:
/sbin/service nfs stop
The restart option is a shorthand way of stopping and then starting nfs. This is the most efficient way to make configuration changes take effect after editing the configuration file for nfs. To restart the server, as root type:
/sbin/service nfs restartThe condrestart (conditional restart) option only starts nfs if it is currently running. This option is useful for scripts, because it does not start the daemon if it is not running. To conditionally restart the server, as root type:
/sbin/service nfs condrestartTo reload the nfs server configuration file without restarting the service, as root type:
/sbin/service nfs reload
By default, the nfs service does not start automatically at boot time. To configure the nfs to start up at boot time, use an initscript utility, such as /sbin/chkconfig, /sbin/ntsysv, or the Services Configuration Tool program. Refer to the chapter titled Controlling Access to Services in Red Hat Enterprise Linux System Administration Guide for more information regarding these tools.
Because portmap provides coordination between RPC services and the port numbers used to communicate with them, it is useful to view the status of current RPC services using portmap when troubleshooting. The rpcinfo command shows each RPC-based service with port numbers, an RPC program number, a version and an IP protocol type (TCP or UDP).
To make sure the proper NFS RPC-based services are enabled for portmap, issue the following command as root:
The following is sample output from this command:
program vers proto port
The output from this command reveals that the correct NFS services are running. If one of the NFS services does not start up correctly, portmap is unable to map RPC requests from clients for that service to the correct port. In many cases, if NFS is not present in rpcinfo output, restarting NFS causes the service to correctly register with portmap and begin working.
Note: Other useful options are available for the rpcinfo command. Refer to the rpcinfo man page for more information.
© 2003-2005 Red Hat, Inc. All rights reserved. This article is made available for copying and use under the Open Publication License, v1.0 which may be found at http://www.opencontent.org/openpub/.