NFS Server Configuration part 1

NFS Server Configuration

There are three different ways to configure an Network File System (NFS) server in Linux: using the NFS Server Configuration Tool  (redhat-config-nfs), manually you can editing its configuration file /etc/exports as well as using the /usr/sbin/exportfs command.

In this thread we are configuring Network File System server by using last two option which is file /etc/exports and /usr/sbin/exportfs.

The /etc/exports file defines which file systems are exported to remote hosts/servers and specifies options.Blank lines are ignored and comments can be made by starting a line with the hash mark (#), and long lines can be wrapped with a backslash (\). Each exported file system should be on its own individual line, and any lists of authorized hosts placed after an exported file system must be separated by space characters. Options for each of the hosts/servers must be placed in parentheses directly after the host identifier, without any spaces separating the host and the first parenthesis.

A line for an exported file system has the following structure:

  1. <export> <host1>(<options>) <hostN>(<options>)…
  2. <export> <host2>(<options>) <hostN>(<options>)…
  3. <export> <host3>(<options>) <hostN>(<options>)…

In this structure, replace <export>  with the directory being exported, replace <host1> with the host/server or network to which the export is being shared, and replace (<options> with the options for that host/server or network. Additional hosts can be specified in a space separated list.

To specify host names refer NFS Server Configuration part 2

About Anant 373 Articles
Senior technical writer