exportfs(1M)
NAME
exportfs − export and unexport directories to NFS clients
SYNOPSIS
/usr/etc/exportfs
/usr/etc/exportfs -a[v]
/usr/etc/exportfs [-auv]
/usr/etc/exportfs [-uv] [dir [dir ...]]
/usr/etc/exportfs -i[v] [-o options] [dir [dir ...]]
DESCRIPTION
exportfs makes a local directory or file available to NFS clients for mounting over the network (directories and files cannot be NFS mounted unless they are first exported by exportfs).
exportfs is normally invoked at boot time by the /etc/netnfsrc script, and uses information contained in the /etc/exports file to export dir (which must be specified as a full pathname). The super-user can run exportfs at any time to alter the list or characteristics of exported directories and files.
If no options or arguments are specified in the command line, exportfs prints a list of currently exported directories and files to the standard output.
Options
exportfs recognizes the following options:
-a All. Export all directories listed in /etc/exports, or if -u is also specified, unexport all of the currently exported directories.
-i Ignore the options in /etc/exports. Normally, exportfs consults /etc/exports for the options associated with the exported directory.
-u Unexport the indicated directories.
-v Verbose. Print each directory or filename as it is exported or unexported.
-o options Specify a comma-separated list of optional characteristics for the directory being exported. options can be selected from among:
async All mounts will be asynchronous. Refer to exports(4) for warnings when using this option.
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 exported read-only to most machines, but read-write to those specified. If not specified, the directory is exported read-write to all. Up to 256 hostnames can be specified.
anon=uid If a request comes from an unknown user, use uid as the effective user ID.
Note: root users (uid0) are always treated as user unknown by the NFS server unless they are included in the root option below.
If the client is a UNIX system, only root users are considered unknown. All other users are recognized even if they are not in /etc/passwd.
The default value for uid is the UID of user nobody. If user nobody does not exist, the value 65534 is used. Setting the value of 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. Up to 256 hostnames can be specified.
access=client[:client]...
Give mount access to each client listed. A client can either be a hostname, or a netgroup (see netgroup(4)). exportfs checks for each client in the list first in file /etc/hosts, then in /etc/netgroup. The default value allows any machine to mount the given directory.
DIAGNOSTICS
If an NFS mounted directory is unexported by exportfs, any access by the client to the directory causes an NFS stale file handle error. However, if exportfs is used to remove a client from the access list of an exported directory, an NFS stale file handle error does not result from any access by the client to the directory.
EXAMPLES
List currently exported directories and files:
exportfs
Export entries in /etc/exports
exportfs -a
Unexport all exported files and directories:
exportfs -ua
Unexport all exported files and directories and print each directory or filename as it is unexported:
exportfs -uav
Export /usr to the world, ignoring options in /etc/exports:
exportfs -i /usr
Export /usr/bin and /usr/adm read-only to the world:
exportfs -i -o ro /usr/bin /usr/adm
Export /usr/bin read-write only to systems polk and vanness:
exportfs -i -o rw=polk:vanness /usr/bin
Export root access on /usr/adm only to the system named pine, and mount access to both pine and geary:
exportfs -i -o root=pine, access=pine:geary /usr/adm
FILES
/etc/exports static export information
/etc/xtab current state of exported directories
/etc/netgroup list of network groups
SEE ALSO
showmount(1M), exports(4), netgroup(4).
WARNINGS
You cannot export a directory that resides within the same file system and is either a parent or sub-directory of a directory that is currently exported. For example, /usr and /usr/local cannot both be exported if they reside in the same disk partition.
If you unexport a directory, remove a client from the access list, then export again, the client still has access to the directory until the client unmounts the directory. Removing a client from the root or rw list takes effect immediately.
/etc/xtab is a system file that lists currently exported directories and files. This file is maintained by exportfs. To ensure that this file is always synchronous with current system data structures, do not attempt to edit it by hand.
Hewlett-Packard Company — HP-UX Release 9.0: August 1992