How to configure Network File System on Linux,

The Network File System (NFS) is probably the most prominent network service using (Remote Procedure Call) RPC. It allows you to access files on remote hosts in exactly the same way you would access local files. One of the more useful things that can be done with networking services is sharing files via a network file system.

Another popular way of sharing files is Samba http://www.samba.org. This protocol allows the sharing of files with MS Windows machines (via Network Neighbourhood). It also allows the sharing of printers across machines.

NFS offers a number of useful features:
        1) Data accessed by all users can be kept on a central host, with clients mounting      this directory at boot time. For example, you can keep all user accounts on one host and have all hosts on your network mount /home from that host. If NFS is installed beside NIS, users can log into any system and still work on one set of files.
        2) Data consuming large amounts of disk space can be kept on a single host. For example, all files and programs relating to LaTeX and METAFONT can be kept and maintained in one place.
        3) Administrative data can be kept on a single host. There is no need to use RCP to install the same stupid file on 20 different machines.

The NFS server runs the following daemons:

NFS (Network File System) version 4 is a distributed file system protocol which owes heritage to NFS protocol versions 2 [RFC1094] and 3 [RFC1813]. Unlike earlier versions, the NFS version 4 protocol supports traditional file access while integrating support for file locking and the mount protocol.

  • rpc.nfsd
  • rpc.mountd
Let’s have a look at how NFS works. First, a client tries to mount a directory from a remote host on a local directory just the same way it does a physical device. However, the syntax used to specify the remote directory is different. For example, to mount 
/home from host  to /users on , the administrator issues the following command on vale:
				
					# mount −t nfs vlager:/home /users
				
			
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

On your NFS host, enable and start the NFS service:

				
					$ sudo systemctl enable --now nfs-server
				
			

You must also start the rpcbind service, which NFS uses for port mapping:

				
					$ sudo systemctl enable --now rpcbind
				
			

Table of Contents

Scroll to Top