Network File Services  «Prev  Next»

Lesson 6 Starting and stopping NFS
Objective Start and stop NFS.

Starting and Stopping NFS

Red Hat Linux starts NFS automatically at boot, but you might need to start and stop NFS to troubleshoot problems. You can start and stop NFS with the control scripts in /etc/rc.d/init.d.
To start NFS with the control script, use:
service portmap start
service nfs start

To stop NFS with the control script, use:
service nfs stop 

Question: What service must be running before you start NFS?
Answer: The portmapper and portmap must be running.

Service to run before you start NFS when using Red Hat

The service that must be running before starting NFS on Red Hat Linux depends on the specific version you're using:
Red Hat Enterprise Linux 4 and earlier:
  1. portmap service needs to be running.
  2. Verify its status with: `/sbin/service portmap status`
  3. Start it with: `/sbin/service portmap start`

Red Hat Enterprise Linux 5 and later:
  • rpcbind service needs to be running.
  • Verify its status with: `systemctl status rpcbind`
  • Start it with: `systemctl start rpcbind`

Additional considerations for specific NFS versions and features:
  1. NFSv3 and earlier (Red Hat Enterprise Linux 7.0 and earlier):
    • nfslock service may also need to be started manually.
    • Check its status with: `systemctl status nfslock`
    • Start it with: `systemctl start nfslock`
  2. NFSv4: Doesn't require nfslock.
  3. Disk quotas: rpc-rquotad service for providing disk quota data to NFS clients.

Key points:
  • Always check and start the necessary services before starting NFS to ensure proper functionality.
  • Use the appropriate commands for your Red Hat Linux version (e.g., `service` for older versions, `systemctl` for newer ones).
  • Consider additional services for specific NFS versions and features.


Starting and Stopping 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.
The next lesson explains how to display currently mounted NFS filesystems.

SEMrush Software