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