Show Table of Contents
8.6. Starting and Stopping the NFS Server
Prerequisites
- For servers that support NFSv2 or NFSv3 connections, the
rpcbind[1] service must be running. To verify thatrpcbindis active, use the following command:$systemctl status rpcbindTo configure an NFSv4-only server, which does not requirerpcbind, see Section 8.7.7, “Configuring an NFSv4-only Server”. - On Red Hat Enterprise Linux 7.0, if your NFS server exports NFSv3 and is enabled to start at boot, you need to manually start and enable the
nfs-lockservice:#systemctl start nfs-lock#systemctl enable nfs-lockOn Red Hat Enterprise Linux 7.1 and later,nfs-lockstarts automatically if needed, and an attempt to enable it manually fails.
Procedures
- To start an NFS server, use the following command:
#
systemctl start nfs - To enable NFS to start at boot, use the following command:
#
systemctl enable nfs - To stop the server, use:
#
systemctl stop nfs - The
restartoption 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 type:#
systemctl restart nfs - After you edit the
/etc/sysconfig/nfsfile, restart the nfs-config service by running the following command for the new values to take effect:#
systemctl restart nfs-config - The
try-restartcommand only startsnfsif it is currently running. This command is the equivalent ofcondrestart(conditional restart) in Red Hat init scripts and is useful because it does not start the daemon if NFS is not running.To conditionally restart the server, type:#
systemctl try-restart nfs - To reload the NFS server configuration file without restarting the service type:
#
systemctl reload nfs

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.