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

DESCRIPTION

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

OPTIONS

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

DISCUSSION

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

EXAMPLES

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

USAGE NOTES

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

FILES

162       /etc/exports             input file listing  exports,  export  options,
163                                and access control lists
164
165       /etc/exports.d           directory  where extra input files are stored.
166                                Note: only files that end  with  .exports  are
167                                used.
168
169       /var/lib/nfs/etab        master table of exports
170
171       /var/lib/nfs/rmtab       table of clients accessing server's exports
172

SEE ALSO

174       exports(5), rpc.mountd(8), netgroup(5)
175

AUTHORS

177       Olaf Kirch <okir@monad.swb.de>
178       Neil Brown <neilb@cse.unsw.edu.au>
179
180
181
182                               31 December 2009                    exportfs(8)
Impressum