Active FTP Passive FTP

NFS (Network File System) Server in Linux

Network File System (NFS)

NFS (Network File System) is basically developed for sharing of files and folders between Linux/Unix systems by Sun Microsystems in 1980. It allows you to mount your local file systems over a network and remote hosts to interact with them as they are mounted locally on the same system. With the help of NFS, we can set up file sharing between Unix to Linux system and Linux to the Unix system.

NFS Structure Linux Unix system


Profile for NFS:

  • Package: nfs-utils
  • Daemons:
  1. rpc.nfsd,
  2. rpc.mountd,
  3. rpc.statd,
  4. rpc.lockd,
  5. rpc.rquotad
  • Script: /etc/init.d/nfs
  • Port number: 2049
  • Configuration File: /etc/exports
  • Other important files:
  1. /var/lib/nfs/etab,
  2. /var/lib/nfs/rmtab

Workflow of NFS and its Daemon

Mounting Process

The process of communication between dæmons both on the server and client.

Communication between Daemons NFS Server


Benefits of NFS

  • NFS allows local access to remote files.
  • It uses standard client/server architecture for file sharing between all *nix based machines.
  • With NFS it is not necessary that both machines run on the same OS.
  • With the help of NFS, we can configure centralized storage solutions.
  • Users get their data irrespective of physical location.
  • No manual refresh needed for new files.
  • A newer version of NFS also supports acl, pseudo root mounts.
  • Can be secured with Firewalls and Kerberos.

NFS Services

  • Its a System V-launched service. The NFS server package includes three facilities, included in the portmap and nfs-utils packages.
  • portmap: It maps calls made from other machines to the correct RPC service (not required with NFSv4).
  • nfs: It translates remote file sharing requests into requests on the local file system.
  • rpc.mountd: This service is responsible for mounting and unmounting of file systems.

Important Files for NFS Configuration

  • /etc/exports: Its a main configuration file of NFS, all exported files and directories are defined in this file at the NFS Server end.
  • /etc/fstab: To mount a NFS directory on your system across the reboots, we need to make an entry in /etc/fstab.
  • /etc/sysconfig/nfs: Configuration file of NFS to control on which port rpc and other services are listening.

Leave a Comment

Your email address will not be published. Required fields are marked *