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
87

CONFIGURATION FILE

89       The [exportfs] section of the /etc/nfs.conf configuration file can con‐
90       tain a debug value, which can be one or more  from  the  list  general,
91       call,  auth,  parse,  all.  When a list is given, the members should be
92       comma-separated.
93
94       exportfs will also recognize the state-directory-path  value  from  the
95       [mountd] section.
96
97

DISCUSSION

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

EXAMPLES

146       The following adds all directories listed  in  /etc/exports  and  files
147       under  /etc/exports.d  to  /var/lib/nfs/etab  and  pushes the resulting
148       export entries into the kernel:
149
150       # exportfs -a
151
152       To export the /usr/tmp directory to host django, allowing insecure file
153       locking requests from clients:
154
155       # exportfs -o insecure_locks django:/usr/tmp
156
157       To unexport the /usr/tmp directory:
158
159       # exportfs -u django:/usr/tmp
160
161       To  unexport  all  exports  listed  in  /etc/exports  and  files  under
162       /etc/exports.d:
163
164       # exportfs -au
165
166       To export the /usr/tmp directory to IPv6 link-local clients:
167
168       # exportfs [fe80::]/64:/usr/tmp
169

USAGE NOTES

171       Exporting to IP networks or DNS and NIS domains does not enable clients
172       from  these  groups  to access NFS immediately.  Rather, these sorts of
173       exports are hints to rpc.mountd(8) to grant  any  mount  requests  from
174       these  clients.   This  is  usually not a problem, because any existing
175       mounts are preserved in rmtab across reboots.
176
177       When unexporting a network or domain entry, any current exports to mem‐
178       bers  of this group will be checked against the remaining valid exports
179       and if they themselves are no longer valid they will be removed.
180

FILES

182       /etc/exports             input file listing  exports,  export  options,
183                                and access control lists
184
185       /etc/exports.d           directory  where extra input files are stored.
186                                Note: only files that end  with  .exports  are
187                                used.
188
189       /var/lib/nfs/etab        master table of exports
190
191       /var/lib/nfs/rmtab       table of clients accessing server's exports
192

SEE ALSO

194       exports(5), nfs.conf(5), rpc.mountd(8), netgroup(5)
195

AUTHORS

197       Olaf Kirch <okir@monad.swb.de>
198       Neil Brown <neilb@cse.unsw.edu.au>
199
200
201
202                               30 September 2013                   exportfs(8)
Impressum