fa656c183ff2af9c63770ccf27a084fa71582759
[dragonfly.git] / sbin / mount_nfs / mount_nfs.8
1 .\" Copyright (c) 1992, 1993, 1994, 1995
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95
33 .\"
34 .\" $FreeBSD: src/sbin/mount_nfs/mount_nfs.8,v 1.18.2.10 2003/05/13 14:45:40 trhodes Exp $
35 .\" $DragonFly: src/sbin/mount_nfs/mount_nfs.8,v 1.3 2005/12/28 13:35:02 swildner Exp $
36 .\""
37 .Dd March 29, 1995
38 .Dt MOUNT_NFS 8
39 .Os
40 .Sh NAME
41 .Nm mount_nfs
42 .Nd mount nfs file systems
43 .Sh SYNOPSIS
44 .Nm
45 .Op Fl 23KNPTUbcdilqs
46 .Op Fl D Ar deadthresh
47 .Op Fl I Ar readdirsize
48 .Op Fl L Ar leaseterm
49 .Op Fl R Ar retrycnt
50 .Op Fl a Ar maxreadahead
51 .Op Fl g Ar maxgroups
52 .Op Fl m Ar realm
53 .Op Fl o Ar options
54 .Op Fl r Ar readsize
55 .Op Fl t Ar timeout
56 .Op Fl w Ar writesize
57 .Op Fl x Ar retrans
58 .Ar rhost : Ns Ar path node
59 .Sh DESCRIPTION
60 The
61 .Nm
62 command
63 calls the
64 .Xr mount 2
65 system call to prepare and graft a remote nfs file system
66 .Pq Ar rhost : Ns Ar path
67 on to the file system tree at the point
68 .Ar node .
69 This command is normally executed by
70 .Xr mount 8 .
71 It implements the mount protocol as described in RFC 1094, Appendix A and
72 .%T "NFS: Network File System Version 3 Protocol Specification" ,
73 Appendix I.
74 .Pp
75 By default,
76 .Nm
77 keeps retrying until the mount succeeds.
78 This behaviour is intended for filesystems listed in
79 .Xr fstab 5
80 that are critical to the boot process.
81 For non-critical filesystems, the
82 .Fl b
83 and
84 .Fl R
85 flags provide mechanisms to prevent the boot process from hanging
86 if the server is unavailable.
87 .Pp
88 If the server becomes unresponsive while an NFS filesystem is
89 mounted, any new or outstanding file operations on that filesystem
90 will hang uninterruptibly until the server comes back.
91 To modify this default behaviour, see the
92 .Fl i
93 and
94 .Fl s
95 flags.
96 .Pp
97 The options are:
98 .Bl -tag -width indent
99 .It Fl 2
100 Use the NFS Version 2 protocol (the default is to try version 3 first
101 then version 2).  Note that NFS version 2 has a file size limit of 2
102 gigabytes.
103 .It Fl 3
104 Use the NFS Version 3 protocol.
105 .It Fl D
106 Used with NQNFS to set the
107 .Dq "dead server threshold"
108 to the specified number of round trip timeout intervals.
109 After a
110 .Dq "dead server threshold"
111 of retransmit timeouts,
112 cached data for the unresponsive server is assumed to still be valid.
113 Values may be set in the range of 1 - 9, with 9 referring to an
114 .Dq "infinite dead threshold"
115 (i.e. never assume cached data still valid).
116 This option is not generally recommended and is really an experimental
117 feature.
118 .It Fl I
119 Set the readdir read size to the specified value.
120 The value should normally
121 be a multiple of DIRBLKSIZ that is <= the read size for the mount.
122 .It Fl K
123 Pass Kerberos authenticators to the server for client-to-server
124 user-credential mapping.
125 This requires that the kernel be built with the NFSKERB option.
126 The use of this option will prevent the kernel from compiling
127 unless calls to the appropriate Kerberos encryption routines
128 are provided in the NFS source.
129 (Refer to the INTERNET-DRAFT titled
130 .%T "Authentication Mechanisms for ONC RPC" ,
131 for more information.)
132 .It Fl L
133 Used with NQNFS to set the lease term to the specified number of seconds.
134 Only use this argument for mounts with a large round trip delay.
135 Values are normally in the 10-30 second range.
136 .It Fl N
137 Do
138 .Em not
139 use a reserved socket port number (see below).
140 .It Fl P
141 Use a reserved socket port number.
142 This flag is obsolete, and only retained for compatibility reasons.
143 Reserved port numbers are used by default now.
144 (For the rare case where the client has a trusted root account
145 but untrustworthy users and the network cables are in secure areas this does
146 help, but for normal desktop clients this does not apply.)
147 .It Fl R
148 Set the mount retry count to the specified value.
149 The default is a retry count of zero, which means to keep retrying
150 forever.
151 There is a 60 second delay between each attempt.
152 .It Fl T
153 Use TCP transport instead of UDP.
154 This is recommended for servers that are not on the same LAN cable as
155 the client.
156 (NB: This is NOT supported by most
157 .No non- Ns Bx
158 servers.)
159 .It Fl U
160 Force the mount protocol to use UDP transport, even for TCP NFS mounts.
161 (Necessary for some old
162 .Bx
163 servers.)
164 .It Fl a
165 Set the read-ahead count to the specified value.
166 This may be in the range of 0 - 4, and determines how many blocks
167 will be read ahead when a large file is being read sequentially.
168 Trying a value greater than 1 for this is suggested for
169 mounts with a large bandwidth * delay product.
170 .It Fl b
171 If an initial attempt to contact the server fails, fork off a child to keep
172 trying the mount in the background.
173 Useful for
174 .Xr fstab 5 ,
175 where the filesystem mount is not critical to multiuser operation.
176 .It Fl c
177 For UDP mount points, do not do a
178 .Xr connect 2 .
179 This must be used if the server does not reply to requests from the standard
180 NFS port number 2049 or replies to requests using a different IP address
181 (which can occur if the server is multi-homed).
182 Setting the
183 .Va vfs.nfs.nfs_ip_paranoia
184 sysctl to 0 will make this option the default.
185 .It Fl d
186 Turn off the dynamic retransmit timeout estimator.
187 This may be useful for UDP mounts that exhibit high retry rates,
188 since it is possible that the dynamically estimated timeout interval is too
189 short.
190 .It Fl g
191 Set the maximum size of the group list for the credentials to the
192 specified value.
193 This should be used for mounts on old servers that cannot handle a
194 group list size of 16, as specified in RFC 1057.
195 Try 8, if users in a lot of groups cannot get response from the mount
196 point.
197 .It Fl i
198 Make the mount interruptible, which implies that file system calls that
199 are delayed due to an unresponsive server will fail with
200 .Er EINTR
201 when a
202 termination signal is posted for the process.
203 .It Fl l
204 Used with NQNFS and NFSV3 to specify that the \fBReaddirPlus\fR RPC should
205 be used.
206 This option reduces RPC traffic for cases such as
207 .Dq "ls -l" ,
208 but tends to flood the attribute and name caches with prefetched entries.
209 Try this option and see whether performance improves or degrades.
210 Probably
211 most useful for client to server network interconnects with a large bandwidth
212 times delay product.
213 .It Fl m
214 Set the Kerberos realm to the string argument.
215 Used with the
216 .Fl K
217 option for mounts to other realms.
218 .It Fl o
219 Options are specified with a
220 .Fl o
221 flag followed by a comma separated string of options.
222 See the
223 .Xr mount 8
224 man page for possible options and their meanings.
225 The following NFS specific option is also available:
226 .Bl -tag -width indent
227 .It port=<port_number>
228 Use specified port number for NFS requests.
229 The default is to query the portmapper for the NFS port.
230 .It acregmin=<seconds>
231 .It acregmax=<seconds>
232 .It acdirmin=<seconds>
233 .It acdirmax=<seconds>
234 When attributes of files are cached, a timeout calculated to determine
235 whether a given cache entry has expired.  These four values determine the
236 upper and lower bounds of the timeouts for ``directory'' attributes and
237 ``regular'' (ie: everything else).  The default values are 3 -> 60 seconds
238 for regular files, and 30 -> 60 seconds for directories.  The algorithm to
239 calculate the timeout is based on the age of the file.  The older the file,
240 the longer the cache is considered valid, subject to the limits above.
241 .El
242 .Pp
243 .Bl -tag -width "dumbtimerXX"
244 \fBHistoric \&-o options\fR
245 .Pp
246 Use of these options is deprecated, they are only mentioned here for
247 compatibility with historic versions of
248 .Nm .
249 .It bg
250 Same as
251 .Fl b .
252 .It conn
253 Same as not specifying
254 .Fl c .
255 .It dumbtimer
256 Same as
257 .Fl d .
258 .It intr
259 Same as
260 .Fl i .
261 .It kerb
262 Same as
263 .Fl K .
264 .It nfsv2
265 Same as
266 .Fl 2 .
267 .It nfsv3
268 Same as
269 .Fl 3 .
270 .It rdirplus
271 Same as
272 .Fl l .
273 .It mntudp
274 Same as
275 .Fl U .
276 .It resvport
277 Same as
278 .Fl P .
279 .It nqnfs
280 Same as
281 .Fl q .
282 .It soft
283 Same as
284 .Fl s .
285 .It tcp
286 Same as
287 .Fl T .
288 .El
289 .It Fl q
290 Use the Not Quite NFS (NQNFS) protocol.
291 This experimental protocol is NFS Version 2 with leasing extensions
292 similar to those found in NFS Version 3.
293 The interoperability of this protocol with other systems is
294 very limited and its implementation is not widely used.
295 Do not use this option unless you know exactly what you are doing!
296 .It Fl r
297 Set the read data size to the specified value.
298 It should normally be a power of 2 greater than or equal to 1024.
299 This should be used for UDP mounts when the
300 .Dq "fragments dropped due to timeout"
301 value is getting large while actively using a mount point.
302 (Use
303 .Xr netstat 1
304 with the
305 .Fl s
306 option to see what the
307 .Dq "fragments dropped due to timeout"
308 value is.)
309 See the
310 .Fl w
311 option as well.
312 .It Fl s
313 A soft mount, which implies that file system calls will fail
314 after \fBRetry\fR round trip timeout intervals.
315 .It Fl t
316 Set the initial retransmit timeout to the specified value.
317 May be useful for fine tuning UDP mounts over internetworks
318 with high packet loss rates or an overloaded server.
319 Try increasing the interval if
320 .Xr nfsstat 1
321 shows high retransmit rates while the file system is active or reducing the
322 value if there is a low retransmit rate but long response delay observed.
323 (Normally, the -d option should be specified when using this option to manually
324 tune the timeout
325 interval.)
326 .It Fl w
327 Set the write data size to the specified value.
328 Ditto the comments w.r.t. the
329 .Fl r
330 option, but using the
331 .Dq "fragments dropped due to timeout"
332 value on the server instead of the client.
333 Note that both the
334 .Fl r
335 and
336 .Fl w
337 options should only be used as a last ditch effort at improving performance
338 when mounting servers that do not support TCP mounts.
339 .It Fl x
340 Set the retransmit timeout count for soft mounts to the specified value.
341 .El
342 .Sh SEE ALSO
343 .Xr mount 2 ,
344 .Xr unmount 2 ,
345 .Xr fstab 5 ,
346 .Xr mount 8 ,
347 .Xr nfsd 8 ,
348 .Xr nfsiod 8 ,
349 .Xr showmount 8
350 .Sh BUGS
351 Due to the way that Sun RPC is implemented on top of UDP (unreliable datagram)
352 transport, tuning such mounts is really a black art that can only be expected
353 to have limited success.
354 For clients mounting servers that are not on the same
355 LAN cable or that tend to be overloaded,
356 TCP transport is strongly recommended,
357 but unfortunately this is restricted to mostly
358 .Bx 4.4
359 servers.