1 .\" $NetBSD: mount_nfs.8,v 1.38 2009/04/08 13:12:20 joerg Exp $
3 .\" Copyright (c) 1992, 1993, 1994, 1995
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95
37 .Nd mount NFS file systems
41 .Op Fl 23bCcdilPpqsTUX
44 .Op Fl a Ar maxreadahead
47 .Op Fl D Ar deadthresh
53 .Op Fl I Ar readdirsize
82 system call to prepare and graft a remote
84 file system (rhost:path)
85 on to the file system tree at the mount point
87 The directory specified by
89 is converted to an absolute path before use.
90 This command is normally executed by
92 It implements the mount protocol as described in RFC 1094, Appendix A and
93 .%T "NFS: Network File System Version 3 Protocol Specification" ,
97 .Bl -tag -width indent
106 The default is to try version 3 first, and
107 fall back to version 2 if the mount fails.
108 .It Fl a Ar maxreadahead
109 Set the read-ahead count to the specified value.
110 This may be in the range of 0 - 4, and determines how many blocks
111 will be read ahead when a large file is being read sequentially.
112 Trying a value greater than 1 for this is suggested for
113 mounts with a large bandwidth * delay product.
115 If an initial attempt to contact the server fails, fork off a child to keep
116 trying the mount in the background.
119 where the filesystem mount is not critical to multiuser operation.
125 Although this flag increases the efficiency of
128 be used for servers that do not reply to requests from the
131 port number 2049, or for servers with multiple network interfaces.
132 In these cases if the socket is connected and the server
133 replies from a different port number or a different network interface
134 the client will get ICMP port unreachable and the mount will hang.
138 mount points, do not do a
140 This flag is deprecated and connectionless
142 mounts are the default.
143 .It Fl D Ar deadthresh
145 .Dq "dead server threshold"
146 to the specified number of round trip timeout intervals.
148 .Dq "dead server threshold"
149 of retransmit timeouts,
151 message is printed to a tty.
153 Turn off the dynamic retransmit timeout estimator.
154 This may be useful for
156 mounts that exhibit high retry rates,
157 since it is possible that the dynamically estimated timeout interval is too
159 .It Fl g Ar maxgroups
160 Set the maximum size of the group list for the credentials to the
162 This should be used for mounts on old servers that cannot handle a
163 group list size of 16, as specified in RFC 1057.
164 Try 8, if users in a lot of groups cannot get response from the mount
166 .It Fl I Ar readdirsize
167 Set the readdir read size to the specified value.
168 The value should normally
171 that is \*[Le] the read size for the mount.
173 Make the mount interruptible, which implies that file system calls that
174 are delayed due to an unresponsive server will fail with
177 termination signal is posted for the process.
178 .It Fl L Ar leaseterm
186 Version 3 to specify that the
192 traffic for cases such as
194 but tends to flood the attribute and name caches with prefetched entries.
195 Try this option and see whether performance improves or degrades.
196 Probably most useful for client to server network
197 interconnects with a large bandwidth times delay product.
199 Options are specified with a
201 flag followed by a comma separated string of options.
204 man page for possible options and their meanings.
208 specific options are also available:
209 .Bl -tag -width indent
216 .It Cm deadthresh Ns = Ns Aq Ar deadthresh
218 .Fl D Ar deadthresh .
225 .It Cm leaseterm Ns = Ns Aq Ar leaseterm
228 .It Cm maxgrps Ns = Ns Aq Ar maxgroups
246 .It Cm port Ns = Ns Aq Ar portnumber
247 Use the specified port number for
250 The default is to query the portmapper for the
256 .It Cm readahead Ns = Ns Aq Ar maxreadahead
258 .Fl a Ar maxreadahead .
259 .It Cm rsize Ns = Ns Aq Ar readsize
268 .It Cm timeo Ns = Ns Aq Ar timeout
271 .It Cm wsize Ns = Ns Aq Ar writesize
276 Use a reserved socket port number.
277 This is the default, and available
278 for backwards compatibility purposes only.
280 Do not use a reserved port number for RPCs.
281 This option is provided only to be able to mimic the old
282 default behavior of not using a reserved port, and should rarely be useful.
289 Set the retry count for doing the mount to the specified value.
290 The default is 10000.
292 Set the read data size to the specified value in bytes.
293 It should normally be a power of 2 greater than or equal to 1024.
295 This should be used for
298 .Dq "fragments dropped after timeout"
299 value is getting large while actively using a mount point.
304 option to see what the
305 .Dq "fragments dropped after timeout"
312 A soft mount, which implies that file system calls will fail
315 round trip timeout intervals.
321 This is recommended for servers that are not on the same physical network as
325 servers, especially not old ones, support this.
327 Set the initial retransmit timeout to the specified value in 0.1 seconds.
328 May be useful for fine tuning
330 mounts over internetworks
331 with high packet loss rates or an overloaded server.
332 Try increasing the interval if
334 shows high retransmit rates while the file system is active or reducing the
335 value if there is a low retransmit rate but long response delay observed.
336 Normally, the -d option should be specified when using this option to manually
339 The default is 3 seconds.
341 Force the mount protocol to use
347 This is necessary for some old
350 .It Fl w Ar writesize
351 Set the write data size to the specified value in bytes.
353 The same logic applies for use of this option as with the
356 option, but using the
357 .Dq "fragments dropped after timeout"
360 server instead of the client.
365 options should only be used as a last ditch effort at improving performance
366 when mounting servers that do not support
370 Perform 32 \*[Lt]-\*[Gt] 64 bit directory cookie translation for version 3 mounts.
371 This may be need in the case of a server using the upper 32 bits of
372 version 3 directory cookies, and when you are running emulated binaries
373 that access such a filesystem.
376 binaries will never need this option.
377 This option introduces some overhead.
379 Set the retransmit timeout count for soft mounts to the specified value.
383 The simplest way to invoke
385 is with a command like:
387 .Dl "mount -t nfs remotehost:/filesystem /localmountpoint"
389 It is also possible to automatically mount filesystems at boot from your
391 by using a line like:
393 .Dl "remotehost:/home /home nfs rw 0 0"
395 As can be derived from the comments accompanying the options, performance
398 can be a non-trivial task.
399 Here are some common points
401 .Bl -bullet -offset indent
403 Increasing the read and write size with the
407 options respectively will increase throughput if the network
408 interface can handle the larger packet sizes.
420 version 3 is platform dependent:
423 the default is 32K, for other platforms it is 8K.
424 Values over 32K are only supported for
426 where 64K is the maximum.
428 Any value over 32K is unlikely to get you more performance, unless
429 you have a very fast network.
431 If the network interface cannot handle larger packet sizes or a
432 long train of back to back packets, you may see low performance
433 figures or even temporary hangups during
437 This can especially happen with older
440 What happens is that either the receive buffer on the network
441 interface on the client side is overflowing, or that similar events
442 occur on the server, leading to a lot of dropped packets.
444 In this case, decreasing the read and write size, using
446 or a combination of both will usually lead to better throughput.
447 Should you need to decrease the read and write size for all your
449 mounts because of a slow
452 .Pq e.g. a USB 1.1 to 10/100 Tn Ethernet network interface ,
456 .It Cd options NFS_RSIZE=value
457 .It Cd options NFS_WSIZE=value
462 file to avoid having do specify the sizes for all mounts.
464 For connections that are not on the same
466 and/or may experience packet loss, using
468 is strongly recommended.
471 Some common problems with
473 can be difficult for first time users to understand.
475 .Dl "mount_nfs: can't access /foo: Permission denied"
477 This message means that the remote host, is either not exporting
478 the filesystem you requested, or is not exporting it to your host.
479 If you believe the remote host is indeed exporting a filesystem to you,
482 file is exporting the proper directories.
484 A common mistake is that
486 will not export a filesystem with the
489 is a mount point on the exporting host.
490 It is not possible to remotely
491 mount a subdirectory of an exported mount, unless it is exported with the
497 .Dl "NFS Portmap: RPC: Program not registered"
499 means that the remote host is not running
503 can be used to determine if the remote host is running nfsd, and mountd by issuing
506 .Dl rpcinfo -p remotehostname
508 If the remote host is running nfsd, and mountd, it would display:
510 .Dl "100005 3 udp 719 mountd"
511 .Dl "100005 1 tcp 720 mountd"
512 .Dl "100005 3 tcp 720 mountd"
513 .Dl "100003 2 udp 2049 nfs"
514 .Dl "100003 3 udp 2049 nfs"
515 .Dl "100003 2 tcp 2049 nfs"
516 .Dl "100003 3 tcp 2049 nfs"
520 .Dl "mount_nfs: can't get net id for host"
524 cannot resolve the name of the remote host.
538 .%T "NFS: Network File System Protocol specification"
543 .%T "NFS Version 2 and Version 3 Security Issues and the NFS Protocol's Use of RPCSEC_GCC and Kerberos V5"
548 .%T "NFS Version 4 Design Considerations"
553 .%T "Authentication Mechanisms for ONC RPC"
556 An NFS server shouldn't loopback-mount its own exported file systems because
557 it's fundamentally prone to deadlock.