]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/exportfs/exportfs.man
man pages: fixed a few typos in a couple man pages
[nfs-utils.git] / utils / exportfs / exportfs.man
1 .\"@(#)exportfs.8"
2 .\"
3 .\" Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
4 .\" Modifications 1999-2003 Neil Brown <neilb@cse.unsw.edu.au>
5 .\"
6 .TH exportfs 8 "31 December 2009"
7 .SH NAME
8 exportfs \- maintain table of exported NFS file systems
9 .SH SYNOPSIS
10 .BI "/usr/sbin/exportfs [-avi] [-o " "options,.." "] [" "client:/path" " ..]
11 .br
12 .BI "/usr/sbin/exportfs -r [-v]"
13 .br
14 .BI "/usr/sbin/exportfs [-av] -u [" "client:/path" " ..]
15 .br
16 .BI "/usr/sbin/exportfs [-v]
17 .br
18 .BI "/usr/sbin/exportfs -f"
19 .br
20 .SH DESCRIPTION
21 An NFS server maintains a table of local physical file systems
22 that are accessible to NFS clients.
23 Each file system in this table is  referred to as an
24 .IR "exported file system" ,
25 or
26 .IR export ,
27 for short.
28 .PP
29 The
30 .B exportfs
31 command maintains the current table of exports for the NFS server.
32 The master export table is kept in a file named
33 .IR /var/lib/nfs/etab .
34 This file is read by
35 .B rpc.mountd
36 when a client sends an NFS MOUNT request.
37 .PP
38 Normally the master export table is initialized with the contents of
39 .I /etc/exports
40 and files under
41 .I /etc/exports.d
42 by invoking
43 .BR "exportfs -a" .
44 However, a system administrator can choose to add or delete
45 exports without modifying
46 .I /etc/exports
47 or files under
48 .I /etc/exports.d
49 by using the
50 .B exportfs
51 command.
52 .PP
53 .B exportfs
54 and its partner program
55 .B rpc.mountd
56 work in one of two modes: a legacy mode which applies to 2.4 and
57 earlier versions of the Linux kernel, and a new mode which applies to
58 2.6 and later versions, providing the
59 .B nfsd
60 virtual filesystem has been mounted at
61 .I /proc/fs/nfsd
62 or
63 .IR /proc/fs/nfs .
64 On 2.6 kernels, if this filesystem is not mounted, the legacy mode is used.
65 .PP
66 In the new mode,
67 .B exportfs
68 does not give any information to the kernel, but provides it only to
69 .B rpc.mountd
70 through the
71 .I /var/lib/nfs/etab
72 file.
73 .B rpc.mountd
74 then manages kernel requests for information about exports, as needed.
75 .PP
76 In the legacy mode,
77 exports which identify a specific host, rather than a subnet or netgroup,
78 are entered directly into the kernel's export table,
79 as well as being written to
80 .IR /var/lib/nfs/etab .
81 Further, exports listed in
82 .I /var/lib/nfs/rmtab
83 which match a non host-specific export request will cause an
84 appropriate export entry for the host given in
85 .I rmtab
86 to be added to the kernel's export table.
87 .SH OPTIONS
88 .TP
89 .B -a
90 Export or unexport all directories.
91 .TP
92 .BI "-o " options,...
93 Specify a list of export options in the same manner as in
94 .BR exports (5).
95 .TP
96 .B -i
97 Ignore the
98 .I /etc/exports
99 file and files under
100 .I /etc/exports.d
101 directory.  Only default options and options given on the command line are used.
102 .TP
103 .B -r
104 Reexport all directories, synchronizing
105 .I /var/lib/nfs/etab
106 with
107 .IR /etc/exports 
108 and files under 
109 .IR /etc/exports.d .
110 This option removes entries in
111 .I /var/lib/nfs/etab
112 which have been deleted from
113 .I /etc/exports
114 or files under
115 .IR /etc/exports.d , 
116 and removes any entries from the
117 kernel export table which are no longer valid.
118 .TP
119 .B -u
120 Unexport one or more directories.
121 .TP
122 .B -f
123 If
124 .I /proc/fs/nfsd
125 or
126 .I /proc/fs/nfs
127 is mounted, flush everything out of the kernel's export table.
128 Fresh entries for active clients are added to the kernel's export table by
129 .B rpc.mountd
130 when they make their next NFS mount request.
131 .TP
132 .B -v
133 Be verbose. When exporting or unexporting, show what's going on. When
134 displaying the current export list, also display the list of export
135 options.
136 .SH DISCUSSION
137 .SS Exporting Directories
138 The first synopsis shows how to invoke
139 .B exportfs
140 when adding new entries to the export table.  When using
141 .BR "exportfs -a" ,
142 all exports listed in
143 .I /etc/exports
144 and files under
145 .I /etc/exports.d
146 are added to
147 .IR /var/lib/nfs/etab .
148 The kernel's export table is also updated as needed.
149 .PP
150 The
151 .I host:/path
152 argument specifies a local directory to export,
153 along with the client or clients who are permitted to access it.
154 See
155 .B exports(5)
156 for a description of supported options and access list formats.
157 To export a directory to the world, simply specify
158 .IR :/path .
159 .PP
160 The export options for a particular host/directory pair derive from
161 several sources.
162 The default export options are
163 .BR sync,ro,root_squash,wdelay .
164 These can be overridden by entries in
165 .IR /etc/exports 
166 or files under
167 .IR /etc/exports.d .
168 .PP
169 A system administrator may override options from these sources using the
170 .B -o
171 command-line option on
172 .BR exportfs .
173 This option takes a comma-separated list of options in the same fashion
174 as one would specify them in
175 .IR /etc/exports .
176 In this way
177 .B exportfs
178 can be used to modify the export options of an already exported directory.
179 .SS Unexporting Directories
180 The third synopsis shows how to unexport a currently exported directory.
181 When using
182 .BR "exportfs -ua" ,
183 all entries listed in
184 .I /var/lib/nfs/etab
185 are removed from the kernel export tables, and the file is cleared. This
186 effectively shuts down all NFS activity.
187 .PP
188 To remove an export, specify a
189 .I host:/path
190 pair. This deletes the specified entry from
191 .I /var/lib/nfs/etab
192 and removes the corresponding kernel entry (if any).
193 .PP
194 .SS Dumping the Export Table
195 Invoking
196 .B exportfs
197 without options shows the current list of exported file systems.
198 Adding the
199 .B -v
200 option causes
201 .B exportfs
202 to display the export options for each export.
203 .SH EXAMPLES
204 The following adds all directories listed in
205 .I /etc/exports
206 and files under
207 .I /etc/exports.d
208 to
209 .I /var/lib/nfs/etab
210 and pushes the resulting export entries into the kernel:
211 .PP
212 .nf
213 .B "# exportfs -a
214 .fi
215 .PP
216 To export the
217 .I /usr/tmp
218 directory to host
219 .BR django ,
220 allowing insecure file locking requests from clients:
221 .PP
222 .nf
223 .B "# exportfs -o insecure_locks django:/usr/tmp
224 .fi
225 .PP
226 To unexport the
227 .I /usr/tmp
228 directory:
229 .PP
230 .nf
231 .B "# exportfs -u django:/usr/tmp
232 .fi
233 .PP
234 To unexport all exports listed in
235 .IR /etc/exports 
236 and files under
237 .IR /etc/exports.d :
238 .PP
239 .nf
240 .B "# exportfs -au
241 .fi
242 .SH USAGE NOTES
243 Exporting to IP networks or DNS and NIS domains does not enable clients
244 from these groups to access NFS immediately.
245 Rather, these sorts of exports are hints to
246 .BR rpc.mountd (8)
247 to grant any mount requests from these clients.
248 This is usually not a problem, because any existing mounts are preserved in
249 .I rmtab
250 across reboots.
251 .PP
252 When unexporting a network or domain entry, any current exports to members
253 of this group will be checked against the remaining valid exports and
254 if they themselves are no longer valid they will be removed.
255 .SH FILES
256 .TP 2.5i
257 .I /etc/exports
258 input file listing exports, export options, and access control lists
259 .TP 2.5i
260 .I /etc/exports.d
261 directory where extra input files are stored.
262 .B Note:
263 only files that end with 
264 .I .exports
265 are used.
266 .TP 2.5i
267 .I /var/lib/nfs/etab
268 master table of exports
269 .TP 2.5i
270 .I /var/lib/nfs/rmtab
271 table of clients accessing server's exports
272 .SH SEE ALSO
273 .BR exports (5),
274 .BR rpc.mountd (8),
275 .BR netgroup (5)
276 .SH AUTHORS
277 Olaf Kirch <okir@monad.swb.de>
278 .br
279 Neil Brown <neilb@cse.unsw.edu.au>