Table of Contents
exportfs - maintain list of NFS exported file systems
/usr/sbin/exportfs
[-av] [-o options,..] [client:/path ..]
/usr/sbin/exportfs [-rv] [-o options,..]
[client:/path ..]
/usr/sbin/exportfs [-av] -u [client:/path ..]
/usr/sbin/exportfs
[-v]
The exportfs command is used to maintain the current
table of exported file systems for NFS. This list is kept in a separate
file named /var/lib/nfs/xtab. Normally, this file is initialized with the
list of all file systems named in /etc/exports by invoking exportfs -a,
and modified by mountd(8)
whenever receiving a mount request from a host
that is matched by a network or domain export.
However, administrators
can choose to add and delete individual file systems without modifying
/etc/exports using exportfs.
- -a
- Export or unexport all directories.
- -o options,...
- Specify a list of export options in the same manner as in
exports(5)
.
- -r
- Reexport all directories. It synchronizes /var/lib/nfs/xtab
with /etc/exports. It removes entries in /var/lib/nfs/xtab which are deleted
from /etc/exports.
- -u
- Unexport one or more directories.
- -v
- Be verbose. When
exporting or unexporting, show what's going on. When displaying the current
export list, also display the list of export options.
The first synopsis shows how to invoke the command when adding
new entries to the export table. When using exportfs -a, all directories
in exports(5)
are added to xtab and the resulting list is pushed into
the kernel.
The host:/path argument specifies the directory to export along
with the host or hosts to export it to. All formats described in exports(5)
are supported; to export a directory to the world, simply specify /path.
The export options for a particular host/directory pair derive from several
sources. The set of default options can be overridden by entries in /usr/etc/exports
and /var/lib/nfs/xtab, if they exists. In addition, the administrator may
overide any options from these sources using the -o argument which takes
a comma-separated list of options in the same fashion as one would specify
them in exports(5)
. Thus, exportfs can also be used to modify the export
options of an already exported directory.
Modifications of the kernel export
table used by nfsd(8)
take place immediately after parsing the command
line and updating the xtab file.
The second synopsis
shows how to unexported a currently exported directory. When using exportfs
-ua, all entries listed in xtab are removed from the kernel export tables,
and the file is cleared. This effectively shuts down all NFS activity.
To
remove individial export entries, one can specify a host:/path pair. This
deletes the specified entry from xtab and removes the corresponding kernel
entry.
Invoking exportfs without further options
shows the current list of exported file systems. When giving the -v option,
the list of flags pertaining to each export are shown in addition.
The following adds all directories listed in /etc/exports to /var/lib/nfs/xtab
and pushes the resulting export entries into the kernel:
# exportfs -a
To export the /usr/tmp directory to host djando, allowing asynchronous
writes, one would do this:
# exportfs django:/usr/tmp -o async
If the directory
was already exported,
Exporting to IP networks, DNS and
NIS domains does not enable clients from these groups to access NFS immediately;
rather, these sorts of exports are hints to mountd(8)
to grant any mount
requests from these clients. This is usually not a big problem, because
any existing mounts are preserved in xtab across reboots.
When unexporting
a network or domain entry, any current exports to members of this group
are unaffected. The reason for this is that exportfs cannot tell whether
these specific exports were created as a result of the group export, or
whether they have been exported independently.
exports(5)
, mountd(8)
Olaf Kirch, <okir@monad.swb.de>
Table of Contents