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