Skip to content

Linux : Starting and Stopping NFS

NFS (Network File System) is a file-sharing protocol that allows a Linux system to share its file system with other systems over a network. It allows a remote system to mount a file system as if it were a local file system and access files on it as if they were stored locally. This makes it easy to share files and directories between different systems and allows for centralized storage and management of files.

NFS uses a client-server architecture, where the system that shares its file system is called the “server” and the systems that access the shared file system are called “clients”.

To use NFS, both the server and the client must have the NFS service installed and configured. The server must export the desired directories, and the client must mount those directories. This can be done through the command line using the exportfs command on the server and the mount command on the client.

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.

It is relatively easy to set up and use, and it provides fast access to shared files. However, it does not provide security features like encryption and authentication.

Brijesh Gogia

2 Comments

  1. Anonymous Anonymous

    I want to cancel this NFS service

  2. Anonymous Anonymous

    Eula

Leave a Reply