RedHat NFS Server Configuration:

What are the required services to share or mount NFS file systems?

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:


How do I start and stop NFS?

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 restart
The 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 condrestart
To 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.


How can I make sure the proper NFS RPC-based services are enabled for portmap?

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:

rpcinfo -p

The following is sample output from this command:

program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100021 1 udp 32774 nlockmgr
100021 3 udp 32774 nlockmgr
100021 4 udp 32774 nlockmgr
100021 1 tcp 34437 nlockmgr
100021 3 tcp 34437 nlockmgr
100021 4 tcp 34437 nlockmgr
100011 1 udp 819 rquotad
100011 2 udp 819 rquotad
100011 1 tcp 822 rquotad
100011 2 tcp 822 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100005 1 udp 836 mountd
100005 1 tcp 839 mountd
100005 2 udp 836 mountd
100005 2 tcp 839 mountd
100005 3 udp 836 mountd
100005 3 tcp 839 mountd

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/.


How well did this entry answer your question?


good wrongincomplete out of date

Other Users Also Viewed