/etc/exports

define remote mount points for NFS mount requests

Name:

/etc/exports

Description:

The exports file defines remote mount points for the NFS mount protocol according to the NFS server specification; see RFC 1094 (Network File System Protocol Specification).

Each line in the file specifies one remote mount point. The first field contains the mount-point directory path, followed optionally by a list of specific hosts separated by whitespace. If no specific hosts are specified, the mount point is exported to all hosts.

By default, all mount points are exported as read/write and with root mapped to -2. To change either of these defaults, specify the appropriate option on the first line of the exports file, following the keyword options.

Here are the export options:

-root=uid
Map root's uid (real user ID). By default, root is mapped to -2.
-ro
Export the filesystem as read-only. By default, the filesystem is exported as read/write.

Note: Specified options are global for all mount points. Options that appear on individual mount-point lines will be ignored.

Let's now look at an example file:

options -root=0
/usr -root=1 rickers snowhite.cis.uoguelph.ca
/usr/local 131.104.48.16
/u -root=5
/u2 -ro

The above example specifies the following:

This mount point: Is exported:
/usr To hosts rickers and snowhite.cis.uoguelph.ca, with root mapped to root
/usr/local To host 131.104.48.16, with root mapped to root
/u To all hosts, with root mapped to root
/u2 Read-only to all hosts, with root mapped to root

Note: Note that the following options are all ignored:
  • -root=1 (for /usr)
  • -root=5 (for /u)
  • -ro (for /u2)

See also:

mountd, nfsd, showmount

RFC 1094 (Network File System Protocol Specification)