• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Linux OS service ‘nfs’

by admin

Service Name

nfs

Description

The Network File System (NFS) is a server/client based networking protocol. NFS daemons are composed by nfsd, rpc.mountd, rpc.rquotad, rpc.lockd.

1. nfsd: nfsd handles client requests from remote systems. Multiple copies of this daemon are usually run so that several requests can be handled simultaneously. However, too many copies of nfsd can increase the demand for CPU time to the point where a drop in performance results. For the best performance the number of copies of nfsd should be set to four.
2. rpc.mountd: rpc.mountd handles mount requests from remote systems.
3. rpc.rquotad: It is a rpc server which returns quotas for a user of a local file system which is NFS-mounted onto a remote machine.
4. rpc.lockd: rpc.lockd manages file locking on NFS client and server machines.

In order to run NFS service, the portmap daemon must run.

Service Management

To manage the NFS service for enabling or disabling the nfs service across reboots, use the chkconfig service:

#/etc/init.d/portmap status
portmap (pid 7428) is running...   [portmap service is started.]
# chkconfig nfs on
# chkconfig --list nfs
nfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off

To start/stop and check the status of nfs service use the service command.

# service nfs
Usage:Usage: nfs {start|stop|status|restart|reload|condrestart}

Start nfs service.

#service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]

Stop nfs service.

# service nfs stop

Name of the package

nfs-utils
nfs-utils-lib

Configuration file

nfs uses the configuration file /etc/exports. The file contains the directories shared with other hosts and access parameters. For example :

# vi /etc/exports
/home/test 192.168.10.10(rw) *(ro,no_root_squash)

It makes the directory /home/test available to any user on 192.168.10.10 in read-write mode (rw) with squashing root privileges, but any other host (*) will have read-only(ro) access without squashing root privileges. Left-to-right scan, first match wins. root_squash means the person who starts the mounting process to this directory will not obtain the root privilege on this NFS server.

The syntax of /etc/exports is very sensitive to whitespace. A common error is to place a space between the host name pattern and the opening parenthesis. This quietly leads to incorrect behavior. Run the GUI configuration utility system-config-nfs to make the configuration easier.

Filed Under: Linux, Linux Services

Some more articles you might also be interested in …

  1. How to use rndc command (command-line administration tool for named)
  2. How to use the “screen” command in Linux
  3. chsh: command not found
  4. pam_tally2 command – lock & unlock ssh failed logins in linux
  5. daemon: command not found
  6. colrm Command Examples in Linux
  7. netstat Command Examples in Linux
  8. How to get Fibre Channel HBA information from Linux SOSreport
  9. flatpak-builder: command not found
  10. How to disable lvmetad in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • qtchooser Command Examples in Linux
  • qtchooser: command not found
  • qsub Command Examples in Linux
  • qsub: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright