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