1exportfs(8)                 System Manager's Manual                exportfs(8)
2
3
4

NAME

6       exportfs - maintain table of exported NFS file systems
7

SYNOPSIS

9       /usr/sbin/exportfs [-avi] [-o options,..] [client:/path ..]
10       /usr/sbin/exportfs -r [-v]
11       /usr/sbin/exportfs [-av] -u [client:/path ..]
12       /usr/sbin/exportfs [-v]
13       /usr/sbin/exportfs -f
14       /usr/sbin/exportfs -s
15

DESCRIPTION

17       An NFS server maintains a table of local physical file systems that are
18       accessible to NFS clients.  Each file system in this table is  referred
19       to as an exported file system, or export, for short.
20
21       The exportfs command maintains the current table of exports for the NFS
22       server.   The  master  export  table  is   kept   in   a   file   named
23       /var/lib/nfs/etab.  This file is read by rpc.mountd when a client sends
24       an NFS MOUNT request.
25
26       Normally the master export table is initialized with  the  contents  of
27       /etc/exports  and  files  under /etc/exports.d by invoking exportfs -a.
28       However, a system administrator can choose to  add  or  delete  exports
29       without  modifying  /etc/exports or files under /etc/exports.d by using
30       the exportfs command.
31
32       exportfs and its partner program rpc.mountd work in one of two modes: a
33       legacy mode which applies to 2.4 and earlier versions of the Linux ker‐
34       nel, and a new mode which applies to 2.6 and later versions,  providing
35       the  nfsd  virtual  filesystem  has  been  mounted  at /proc/fs/nfsd or
36       /proc/fs/nfs.  On 2.6 kernels, if this filesystem is not  mounted,  the
37       legacy mode is used.
38
39       In  the new mode, exportfs does not give any information to the kernel,
40       but provides it only to rpc.mountd through the /var/lib/nfs/etab  file.
41       rpc.mountd  then manages kernel requests for information about exports,
42       as needed.
43
44       In the legacy mode, exports which identify a specific host, rather than
45       a subnet or netgroup, are entered directly into the kernel's export ta‐
46       ble, as well as being written to /var/lib/nfs/etab.   Further,  exports
47       listed  in  /var/lib/nfs/rmtab  which  match a non host-specific export
48       request will cause an appropriate export entry for the  host  given  in
49       rmtab to be added to the kernel's export table.
50

OPTIONS

52       -d kind  or  --debug kind
53              Turn on debugging. Valid kinds are: all, auth, call, general and
54              parse.  Debugging can also be turned on by setting debug= in the
55              [exportfs] section of /etc/nfs.conf.
56
57
58       -a     Export or unexport all directories.
59
60       -o options,...
61              Specify  a  list  of  export  options  in  the same manner as in
62              exports(5).
63
64       -i     Ignore the /etc/exports  file  and  files  under  /etc/exports.d
65              directory.   Only  default options and options given on the com‐
66              mand line are used.
67
68       -r     Reexport all directories, synchronizing  /var/lib/nfs/etab  with
69              /etc/exports   and  files  under  /etc/exports.d.   This  option
70              removes entries in /var/lib/nfs/etab  which  have  been  deleted
71              from /etc/exports or files under /etc/exports.d, and removes any
72              entries from the kernel export table which are no longer valid.
73
74       -u     Unexport one or more directories.
75
76       -f     If /proc/fs/nfsd or /proc/fs/nfs is  mounted,  flush  everything
77              out  of  the  kernel's  export  table.  Fresh entries for active
78              clients are added to the kernel's  export  table  by  rpc.mountd
79              when they make their next NFS mount request.
80
81       -v     Be verbose. When exporting or unexporting, show what's going on.
82              When displaying the current export list, also display  the  list
83              of export options.
84
85       -s     Display the current export list suitable for /etc/exports.
86

DISCUSSION

88   Exporting Directories
89       The first synopsis shows how to invoke exportfs when adding new entries
90       to the export table.  When using exportfs -a,  all  exports  listed  in
91       /etc/exports    and   files   under   /etc/exports.d   are   added   to
92       /var/lib/nfs/etab.  The  kernel's  export  table  is  also  updated  as
93       needed.
94
95       The  host:/path  argument  specifies a local directory to export, along
96       with the client or  clients  who  are  permitted  to  access  it.   See
97       exports(5)  for a description of supported options and access list for‐
98       mats.
99
100       IPv6 presentation addresses contain colons, which are already  used  to
101       separate the "host" and "path" command line arguments.  When specifying
102       a client using a raw IPv6 address, enclose the address in square brack‐
103       ets.  For IPv6 network addresses, place the prefix just after the clos‐
104       ing bracket.
105
106       To export a directory to the world, simply specify :/path.
107
108       The export options for a particular  host/directory  pair  derive  from
109       several     sources.      The     default     export     options    are
110       sync,ro,root_squash,wdelay.  These can  be  overridden  by  entries  in
111       /etc/exports or files under /etc/exports.d.
112
113       A  system  administrator  may override options from these sources using
114       the -o command-line option on exportfs.  This option takes a comma-sep‐
115       arated list of options in the same fashion as one would specify them in
116       /etc/exports.  In this way exportfs can be used to  modify  the  export
117       options of an already exported directory.
118
119   Unexporting Directories
120       The  third  synopsis  shows how to unexport a currently exported direc‐
121       tory.  When using exportfs -ua, all entries listed in /var/lib/nfs/etab
122       are  removed  from  the  kernel export tables, and the file is cleared.
123       This effectively shuts down all NFS activity.
124
125       To remove an export, specify a host:/path pair. This deletes the speci‐
126       fied  entry from /var/lib/nfs/etab and removes the corresponding kernel
127       entry (if any).
128
129   Dumping the Export Table
130       Invoking exportfs without options shows the current  list  of  exported
131       file  systems.   Adding  the  -v  option causes exportfs to display the
132       export options for each export.
133

EXAMPLES

135       The following adds all directories listed  in  /etc/exports  and  files
136       under  /etc/exports.d  to  /var/lib/nfs/etab  and  pushes the resulting
137       export entries into the kernel:
138
139       # exportfs -a
140
141       To export the /usr/tmp directory to host django, allowing insecure file
142       locking requests from clients:
143
144       # exportfs -o insecure_locks django:/usr/tmp
145
146       To unexport the /usr/tmp directory:
147
148       # exportfs -u django:/usr/tmp
149
150       To  unexport  all  exports  listed  in  /etc/exports  and  files  under
151       /etc/exports.d:
152
153       # exportfs -au
154
155       To export the /usr/tmp directory to IPv6 link-local clients:
156
157       # exportfs [fe80::]/64:/usr/tmp
158

USAGE NOTES

160       Exporting to IP networks or DNS and NIS domains does not enable clients
161       from  these  groups  to access NFS immediately.  Rather, these sorts of
162       exports are hints to rpc.mountd(8) to grant  any  mount  requests  from
163       these  clients.   This  is  usually not a problem, because any existing
164       mounts are preserved in rmtab across reboots.
165
166       When unexporting a network or domain entry, any current exports to mem‐
167       bers  of this group will be checked against the remaining valid exports
168       and if they themselves are no longer valid they will be removed.
169

FILES

171       /etc/exports             input file listing  exports,  export  options,
172                                and access control lists
173
174       /etc/exports.d           directory  where extra input files are stored.
175                                Note: only files that end  with  .exports  are
176                                used.
177
178       /var/lib/nfs/etab        master table of exports
179
180       /var/lib/nfs/rmtab       table of clients accessing server's exports
181

SEE ALSO

183       exports(5), nfs.conf(5), rpc.mountd(8), netgroup(5)
184

AUTHORS

186       Olaf Kirch <okir@monad.swb.de>
187       Neil Brown <neilb@cse.unsw.edu.au>
188
189
190
191                               30 September 2013                   exportfs(8)
Impressum