exports File for NFS
Purpose
Contains a list of directories that can be exported to Network File System (NFS) clients.
Description
The /etc/exports file contains an entry for each directory that can be exported to NFS clients. This file is read automatically by the exportfs command. If you change this file, you must run the exportfs command before the changes can affect the way the daemon operates.
If there are two entries for the same directory with different NFS versions 2 (or 3) and NFS versions 4 in the /etc/exports file, the exportfs command exports both of the two entries.
If the options for NFS versions 2 (or 3) and 4 are the same for a
directory, there can be one entry in the /etc/exports file
specifying -vers=3:4
.
Entries in the file are formatted as follows:
Directory-Option [ , Option ] ...
These entries are defined as follows:
Entry | Definition |
---|---|
Directory | Specifies the directory name. |
Option | Specifies the optional characteristics for the directory being
exported. You can enter more than one variable by separating them
with commas. For options taking a Client parameter, Client can specify
a hostname, a dotted IP address, a network name, or a subnet designator.
A subnet designator is of the form @host/mask, where host
is either a hostname or a dotted IP address and mask specifies the
number of bits to use when checking access. If mask is not
specified, a full mask is used. For example, the designator @client.group.company.com/16 will match all Clients on the
company.com subnet. A designator of @client.group.company.com/24 will match only the Clients on the group.company.com subnet. Choose
from the following options:
|
|
|
Option (continued) |
|
Option (continued) |
|
nfsroot and nfspublic
- The nfsroot must not be "/".
- Either all version 4 exports must specify an external name, or none must specify an external name.
- The external name must start with the nfsroot name. For example, if the nfsroot has been set to /export/server, the directory /export/server/abc can be used as an external name, but the directory /abc cannot be used as an external name. In this example, the /tmp directory might be exported as /export/server/tmp, but /tmp cannot be exported as /xyz.
- If the -exname option is used, only one directory can be exported per file system.
- If a directory is exported with an external name, any descendant of that directory that is also exported must maintain the same path between the two directories. For example, if /a is exported as /export/dira, the directory /a/b/c/d can only be exported as /export/dira/b/c/d, provided /a and /a/b/c/d are different file systems or members of different file systems.
- If a directory is exported with an external name, any parent of that directory that is also exported must maintain the same path between the two directories. For example, if /a/b is exported as /export/a/b, the directory /a can only be exported as /export/a, provided /a and /a/b are different file systems or members of different file systems. Also, if /a/b is exported as /export/b, the directory /a cannot be exported because it does not exist in the path from the root node to export a pathname of /b.
- The exportfs command will only allow the exname option when the -vers=4 options is also present.
Administration of nfsroot, nfspublic, and replication is performed using the chnfs command.
Examples
- To export to netgroup clients, enter:
/usr -access=clients
- To export to the world, enter:
/usr/local
- To export to only these systems, enter:
/usr2 -access=hermes:zip:tutorial
- To give root access only to these systems, enter:
/usr/tps -root=hermes:zip
- To convert client root users to guest UID=100, enter:
/usr/new -anon=100
- To export read-only to everyone, enter:
/usr/bin -ro
- To allow several options on one line, enter:
/usr/stuff -access=zip,anon=-3,ro
- To create a referral at /usr/info to the /usr/info directory on the host infoserver, add the following line
to /etc/exports and then export /usr/info:
/usr/info -vers=4,refer=/usr/info@infoserver
- To specify replicas for the directory /common/info at hosts backup1 and backup2, add the following line to /etc/exports and then export /common/info:
/common/info -vers=4,replicas=/common/info@backup1:/common/info@backup2,<other options>
Files
Item | Description |
---|---|
/etc/xtab | Lists currently exported directories. |
/etc/hosts | Contains an entry for each host on the network. |
/etc/netgroup | Contains information about each user group on the network. |