exports(4)
NAME
exports, xtab − directories to export to NFS clients
SYNOPSIS
/etc/exports
/etc/xtab
DESCRIPTION
File /etc/exports describes the directories that can be exported to NFS clients. The system administrator creates it using a text editor. mountd processes it each time a mount request is received (see mountd(1M)).
/etc/exports is read automatically by the exportfs command (see exportfs (1M)). If this file is changed, exportfs must be run (exportfs -a) before the changes can affect the daemon’s operation.
Only when this file is present at boot time does the /etc/netnfsrc script execute exportfs and the NFS filesystem daemon, nfsd (see nfsd(1M)).
/etc/xtab contains entries for directories that are currently exported. This file should only be accessed by programs using getexportent (see exportent(3)). (Use exportfs -u to remove entries from this file).
An entry for a directory consists of a line of the following form:
directory -option [, option]...
Where directory is the pathname of a directory (or file).
options can have any of the following values and forms:
ro Export the directory read-only. If not specified, the directory is exported read-write.
rw=hostname[:hostname]...
Export the directory read-mostly. Read-mostly means read-only to most machines, but read-write to those specified. If not specified, the directory is exported read-write to all.
anon=uid If a request comes from an unknown user, use uid as the effective user ID. Note: Root users (uid 0) are always considered “unknown” by the NFS server unless they are included in the “root” option below.
The default value for this option is 65534. Setting anon to 65535 disables anonymous access.
root=hostname[:hostname]...
Give root access only to the root users from a specified hostname. The default is for no hosts to be granted root access.
access=client[:client]...
Give mount access to each client listed. A client can either be a hostname or a netgroup (see netgroup(4)). Each client in the list is first checked in the netgroup database, then in the hosts database. A directory name with no accompanying name list allows any machine to mount the given directory.
async Specifying async increases write performance on the NFS server by causing asynchronous writes on the NFS server. The async option can be specified anywhere on the command line after the file system name. Before using this option, refer to WARNINGS below.
# A # character anywhere in the file indicates a comment that extends to the end of the line.
/etc/exports contains a list of file systems and the netgroup or machine names allowed to remotely mount each file system (see netgroup(4)). The file system names are left-justified and followed by a list of names separated by white space. The names are searched for in /etc/netgroup then in /etc/hosts. A file system name with no accompanying name list means the file system is available to everyone.
A # anywhere in the file indicates a comment extending to the end of that line.
EXAMPLES
/usr/games cocoa fudge # export to only these machines
/usr -access=clients # export to my clients
/usr/local # export to the world
/usr2 -access=bison:deer:pup # export to only these machines
/usr/adm -root=bison:deer # give root access only to these
/usr/new -anon=0 # give all machines root access
/usr/temp -rw=ram:alligator # export read-write only to these
/usr/bin -ro # export read-only to everyone
/usr/stuff -access=bear,anon=-65534,ro
# several options on one line
WARNINGS
You cannot export either a parent directory or a subdirectory of an exported directory that resides within the same filesystem. It is not allowed, for instance, to export both /usr and /usr/local if both directories reside on the same disk partition.
Do not use the async option if one of the following conditions applies to a file system that you want to export:
• The file system contains files that are accessed using the O_SYNCIO flag (which is set by fcntl() or open() calls (see fcntl(2) and open(2)).
• The file system contains data that cannot be reconstructed (for example, the file system contains database files),
• The file system contains files synchronized with fsync(2), or
• The file system contains critical applications requiring absolute data integrity. If you are unsure whether any of the previous conditions apply, do not use the async option. If the async option is used, an unreported data loss may occur if the option is set and the NFS server hardware experiences a power loss, system panic, or other failure. Specifically, blocks which have been queued for the server’s disk, but have not yet been written to the disk may be lost.
AUTHOR
exports was developed by Sun Microsystems, Inc.
FILES
/etc/exports
/etc/xtab
/etc/hosts
/etc/netgroup
/etc/netnfsrc
SEE ALSO
exportfs(1M), mountd(1M), nfsd(1M), exportent(3), hosts(4), netgroup(4).
Hewlett-Packard Company — HP-UX Release 9.0: August 1992