Debian Codegraph @

upstream/debian-trixie/man8/exportfs.8

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