Installation guide
Chapter 10. Network File System (NFS)
68
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:
service nfs condrestart
To reload the NFS server configuration file without restarting the service, as root, type:
service nfs reload
10.6. NFS Server Configuration
There are two ways to configure an NFS server:
• By manually editing the NFS configuration file, i.e. /etc/exports
• Through the command line, i.e. through exportfs
10.6.1. The /etc/exports Configuration File
The /etc/exports file controls which file systems are exported to remote hosts and specifies
options. It follows the following syntax rules:
• Blank lines are ignored.
• To add a comment, start a line with the hash mark (#).
• You can wrap long lines with a backslash (\).
• Each exported file system should be on its own individual line.
• Any lists of authorized hosts placed after an exported file system must be separated by space
characters.
• Options for each of the hosts must be placed in parentheses directly after the host identifier, without
any spaces separating the host and the first parenthesis.
Each entry for an exported file system has the following structure:
export host(options)
The aforementioned structure uses the following variables:
export
The directory being exported
host
The host or network to which the export is being shared
options
The options to be used for host
You can specify multiple hosts, along with specific options for each host. To do so, list them on
the same line as a space-delimited list, with each hostname followed by its respective options (in
parentheses), as in: