]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/exportfs/exportfs.man
7d18509e69b88c5d52e5385f524bb2540eec47ab
[nfs-utils.git] / utils / exportfs / exportfs.man
1 .\"
2 .\" exportfs(8)
3 .\" 
4 .\" Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
5 .\" Modifications 1999-2003 Neil Brown <neilb@cse.unsw.edu.au>
6 .TH exportfs 8 "18 July 2003"
7 .SH NAME
8 exportfs \- maintain list of NFS exported 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 The
22 .B exportfs
23 command is used to maintain the current table of exported file systems for
24 NFS. This list is kept in a separate file named
25 .BR /var/lib/nfs/xtab
26 which is read by
27 .B mountd
28 when a remote host requests access to mount a file tree, and parts of
29 the list which are active are kept in the kernel's export table.
30 .P
31 Normally this 
32 .B xtab
33 file is initialized with the list of all file systems named in
34 .B /etc/exports 
35 by invoking
36 .BR "exportfs -a" .
37 .P
38 However, administrators can choose to add and delete individual file systems
39 without modifying
40 .B /etc/exports
41 using
42 .BR exportfs .
43 .P
44 .B exportfs
45 and it's partner program
46 .B mountd
47 work in one of two modes, a legacy mode which applies to 2.4 and
48 earlier versions of the Linux kernel, and a new mode which applies to
49 2.6 and later versions providing the
50 .B nfsd
51 virtual filesystem has been mounted at
52 .BR /proc/fs/nfs .
53 If this filesystem is not mounted in 2.6, the legacy mode is used.
54 .P
55 In the new mode,
56 .B exportfs
57 does not give any information to the kernel but only provides it to
58 .B mountd
59 through the
60 .B /var/lib/nfs/xtab
61 file.
62 .B mountd
63 will listen to requests from the kernel and will provide information
64 as needed.
65 .P
66 In the legacy mode,
67 any export requests which identify a specific host (rather than a
68 subnet or netgroup etc) are entered directly into the kernel's export
69 table as well as being written to
70 .BR /var/lib/nfs/xtab .
71 Further, any mount points listed in
72 .B /var/lib/nfs/rmtab
73 which match a non host-specific export request will cause an
74 appropriate export entry for the host given in
75 .B rmtab
76 to be entered
77 into the kernel's export table.
78 .SH OPTIONS
79 .TP 
80 .B -a
81 Export or unexport all directories.
82 .TP
83 .BI "-o " options,...
84 Specify a list of export options in the same manner as in
85 .BR exports(5) .
86 .TP
87 .B -i
88 Ignore the
89 .B /etc/exports
90 file, so that only default options and options given on the command
91 line are used.
92 .TP
93 .B -r
94 Reexport all directories. It synchronizes /var/lib/nfs/xtab
95 with /etc/exports. It removes entries in /var/lib/nfs/xtab
96 which are deleted from /etc/exports, and remove any entries from the
97 kernel export table which are no longer valid.
98 .TP
99 .B -u
100 Unexport one or more directories.
101 .TP
102 .B -f
103 In 'new' mode, flush everything out of the kernels export table. Any
104 clients that are active will get new entries added by
105 .B mountd
106 when they make their next request.
107 .TP
108 .B -v
109 Be verbose. When exporting or unexporting, show what's going on. When
110 displaying the current export list, also display the list of export
111 options.
112 .SH DISCUSSION
113 .\" -------------------- Exporting Directories --------------------
114 .SS Exporting Directories
115 The first synopsis shows how to invoke the command when adding new
116 entries to the export table.  When using 
117 .BR "exportfs -a" ,
118 all directories in
119 .B exports(5)
120 are added to
121 .B xtab
122 and the resulting list is pushed into the kernel.
123 .P
124 The
125 .I host:/path
126 argument specifies the directory to export along with the host or hosts to
127 export it to. All formats described in
128 .B exports(5)
129 are supported; to export a directory to the world, simply specify
130 .IR :/path .
131 .P
132 The export options for a particular host/directory pair derive from
133 several sources.  There is a set of default options which can be overridden by
134 entries in
135 .B /etc/exports
136 (unless the
137 .B -i
138 option is given).
139 In addition, the administrator may overide any options from these sources
140 using the
141 .B -o
142 argument which takes a comma-separated list of options in the same fashion
143 as one would specify them in
144 .BR exports(5) .
145 Thus,
146 .B exportfs
147 can also be used to modify the export options of an already exported
148 directory.
149 .P
150 Modifications of the kernel export table used by
151 .B nfsd(8)
152 take place immediately after parsing the command line and updating the
153 .B xtab
154 file.
155 .P
156 The default export options are
157 .BR sync,ro,root_squash,no_delay .
158 .\" -------------------- Unexporting Directories ------------------
159 .SS Unexporting Directories
160 The third synopsis shows how to unexported a currently exported directory.
161 When using
162 .BR "exportfs -ua" ,
163 all entries listed in
164 .B xtab
165 are removed from the kernel export tables, and the file is cleared. This
166 effectively shuts down all NFS activity.
167 .P
168 To remove individial export entries, one can specify a
169 .I host:/path
170 pair. This deletes the specified entry from
171 .B xtab
172 and removes the corresponding kernel entry (if any).
173 .P
174 .\" -------------------- Dumping the Export Table -----------------
175 .SS Dumping the Export Table 
176 Invoking
177 .B exportfs
178 without further options shows the current list of exported file systems.
179 When giving the
180 .B -v
181 option, the list of flags pertaining to each export are shown in addition.
182 .\" -------------------- EXAMPLES ---------------------------------
183 .SH EXAMPLES
184 The following adds all directories listed in
185 .B /etc/exports to /var/lib/nfs/xtab
186 and pushes the resulting export entries into the kernel:
187 .P
188 .nf
189 .B "# exportfs -a
190 .fi
191 .P
192 To export the
193 .B /usr/tmp
194 directory to host 
195 .BR djando ,
196 allowing asynchronous writes, one would do this:
197 .P
198 .nf
199 .B "# exportfs -o async django:/usr/tmp
200 .fi
201 .\" -------------------- DEPENDENCIES -----------------------------
202 .SH DEPENDENCIES
203 Exporting to IP networks, DNS and NIS domains does not enable clients
204 from these groups to access NFS immediately; rather, these sorts of
205 exports are hints to
206 .B mountd(8)
207 to grant any mount requests from these clients.
208 This is usually not a big problem, because any existing mounts are preserved
209 in
210 .B rmtab
211 across reboots.
212 .P
213 When unexporting a network or domain entry, any current exports to members
214 of this group will be checked against the remaining valid exports and
215 if they themselves are nolonger valid they will be removed.
216 .P
217 .\" -------------------- SEE ALSO --------------------------------
218 .SH SEE ALSO
219 .BR exports(5) ", " mountd(8)
220 .\" -------------------- AUTHOR ----------------------------------
221 .SH AUTHORS
222 Olaf Kirch, <okir@monad.swb.de>
223 .br
224 Neil Brown, <neilb@cse.unsw.edu.au>
225