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$ 35.\"" 36.Dd March 29, 1995 37.Dt MOUNT_NFS 8 38.Os 39.Sh NAME 40.Nm mount_nfs 41.Nd mount nfs file systems 42.Sh SYNOPSIS 43.Nm 44.Op Fl 23NPTUbcdiLls 45.Op Fl D Ar deadthresh 46.Op Fl I Ar readdirsize 47.Op Fl R Ar retrycnt 48.Op Fl a Ar maxreadahead 49.Op Fl g Ar maxgroups 50.Op Fl o Ar options 51.Op Fl r Ar readsize 52.Op Fl t Ar timeout 53.Op Fl w Ar writesize 54.Op Fl x Ar retrans 55.Ar rhost : Ns Ar path node 56.Sh DESCRIPTION 57The 58.Nm 59utility calls the 60.Xr mount 2 61system call to prepare and graft a remote nfs file system 62.Pq Ar rhost : Ns Ar path 63on to the file system tree at the point 64.Ar node . 65This command is normally executed by 66.Xr mount 8 . 67It implements the mount protocol as described in RFC 1094, Appendix A and 68.%T "NFS: Network File System Version 3 Protocol Specification" , 69Appendix I. 70.Pp 71By default, 72.Nm 73keeps retrying until the mount succeeds. 74This behaviour is intended for file systems listed in 75.Xr fstab 5 76that are critical to the boot process. 77For non-critical file systems, the 78.Fl b 79and 80.Fl R 81flags provide mechanisms to prevent the boot process from hanging 82if the server is unavailable. 83.Pp 84If the server becomes unresponsive while an NFS file system is 85mounted, any new or outstanding file operations on that file system 86will hang uninterruptibly until the server comes back. 87To modify this default behaviour, see the 88.Fl i 89and 90.Fl s 91flags. 92.Pp 93The options are: 94.Bl -tag -width indent 95.It Fl 2 96Use the NFS Version 2 protocol (the default is to try version 3 first 97then version 2). Note that NFS version 2 has a file size limit of 2 98gigabytes. 99.It Fl 3 100Use the NFS Version 3 protocol. 101.It Fl D 102Set the 103.Dq "dead server threshold" 104to the specified number of round trip timeout intervals before a 105.Dq "server not responding" 106message is displayed. 107.It Fl I 108Set the readdir read size to the specified value. 109The value should normally 110be a multiple of DIRBLKSIZ that is <= the read size for the mount. 111.It Fl L 112Do 113.Em not 114forward 115.Xr fcntl 2 116locks over the wire. 117All locks will be local and not seen by the server 118and likewise not seen by other NFS clients. This removes 119the need to run the 120.Xr rpcbind 8 121service and the 122.Xr rpc.statd 8 123and 124.Xr rpc.lockd 8 125servers on the client. 126Note that this option will only be honored when performing the 127initial mount, it will be silently ignored if used while updating 128the mount options. 129.It Fl N 130Do 131.Em not 132use a reserved socket port number (see below). 133.It Fl P 134Use a reserved socket port number. 135This flag is obsolete, and only retained for compatibility reasons. 136Reserved port numbers are used by default now. 137This is useful for mounting servers that require clients to use a 138reserved port number on the mistaken belief that this makes NFS 139more secure. 140(For the rare case where the client has a trusted root account 141but untrustworthy users and the network cables are in secure areas this does 142help, but for normal desktop clients this does not apply.) 143.It Fl R 144Set the mount retry count to the specified value. 145The default is a retry count of zero, which means to keep retrying 146forever. 147There is a 60 second delay between each attempt. 148.It Fl T 149Use TCP transport instead of UDP. 150This is recommended for servers that are not on the same LAN cable as 151the client. 152(NB: This is NOT supported by most 153.No non- Ns Bx 154servers.) 155.It Fl U 156Force the mount protocol to use UDP transport, even for TCP NFS mounts. 157(Necessary for some old 158.Bx 159servers.) 160.It Fl a 161Set the read-ahead count to the specified value. 162This may be in the range of 0 - 4, and determines how many blocks 163will be read ahead when a large file is being read sequentially. 164Trying a value greater than 1 for this is suggested for 165mounts with a large bandwidth * delay product. 166.It Fl b 167If an initial attempt to contact the server fails, fork off a child to keep 168trying the mount in the background. 169Useful for 170.Xr fstab 5 , 171where the file system mount is not critical to multiuser operation. 172.It Fl c 173For UDP mount points, do not do a 174.Xr connect 2 . 175This must be used for servers that do not reply to requests from the 176standard NFS port number 2049. 177.It Fl d 178Turn off the dynamic retransmit timeout estimator. 179This may be useful for UDP mounts that exhibit high retry rates, 180since it is possible that the dynamically estimated timeout interval is too 181short. 182.It Fl g 183Set the maximum size of the group list for the credentials to the 184specified value. 185This should be used for mounts on old servers that cannot handle a 186group list size of 16, as specified in RFC 1057. 187Try 8, if users in a lot of groups cannot get response from the mount 188point. 189.It Fl i 190Make the mount interruptible, which implies that file system calls that 191are delayed due to an unresponsive server will fail with EINTR when a 192termination signal is posted for the process. 193.It Fl l 194Used with NQNFS and NFSV3 to specify that the \fBReaddirPlus\fR RPC should 195be used. 196This option reduces RPC traffic for cases such as 197.Dq "ls -l" , 198but tends to flood the attribute and name caches with prefetched entries. 199Try this option and see whether performance improves or degrades. 200Probably 201most useful for client to server network interconnects with a large bandwidth 202times delay product. 203.It Fl o 204Options are specified with a 205.Fl o 206flag followed by a comma separated string of options. 207See the 208.Xr mount 8 209man page for possible options and their meanings. 210The following NFS specific option is also available: 211.Bl -tag -width indent 212.It port=<port_number> 213Use specified port number for NFS requests. 214The default is to query the portmapper for the NFS port. 215.It acregmin=<seconds> 216.It acregmax=<seconds> 217.It acdirmin=<seconds> 218.It acdirmax=<seconds> 219When attributes of files are cached, a timeout calculated to determine 220whether a given cache entry has expired. These four values determine the 221upper and lower bounds of the timeouts for ``directory'' attributes and 222``regular'' (ie: everything else). The default values are 3 -> 60 seconds 223for regular files, and 30 -> 60 seconds for directories. The algorithm to 224calculate the timeout is based on the age of the file. The older the file, 225the longer the cache is considered valid, subject to the limits above. 226.El 227.Pp 228.Bl -tag -width "dumbtimerXX" 229\fBHistoric \&-o options\fR 230.Pp 231Use of these options is deprecated, they are only mentioned here for 232compatibility with historic versions of 233.Nm . 234.It bg 235Same as 236.Fl b . 237.It conn 238Same as not specifying 239.Fl c . 240.It dumbtimer 241Same as 242.Fl d . 243.It intr 244Same as 245.Fl i . 246.It lockd 247Same as not specifying 248.Fl L . 249.It nfsv2 250Same as 251.Fl 2 . 252.It nfsv3 253Same as 254.Fl 3 . 255.It rdirplus 256Same as 257.Fl l . 258.It mntudp 259Same as 260.Fl U . 261.It resvport 262Same as 263.Fl P . 264.It seqpacket 265Same as 266.Fl p . 267.It soft 268Same as 269.Fl s . 270.It tcp 271Same as 272.Fl T . 273.El 274.It Fl r 275Set the read data size to the specified value. 276It should normally be a power of 2 greater than or equal to 1024. 277This should be used for UDP mounts when the 278.Dq "fragments dropped due to timeout" 279value is getting large while actively using a mount point. 280(Use 281.Xr netstat 1 282with the 283.Fl s 284option to see what the 285.Dq "fragments dropped due to timeout" 286value is.) 287See the 288.Fl w 289option as well. 290.It Fl s 291A soft mount, which implies that file system calls will fail 292after \fBRetry\fR round trip timeout intervals. 293.It Fl t 294Set the initial retransmit timeout to the specified value. 295May be useful for fine tuning UDP mounts over internetworks 296with high packet loss rates or an overloaded server. 297Try increasing the interval if 298.Xr nfsstat 1 299shows high retransmit rates while the file system is active or reducing the 300value if there is a low retransmit rate but long response delay observed. 301(Normally, the -d option should be specified when using this option to manually 302tune the timeout 303interval.) 304.It Fl w 305Set the write data size to the specified value. 306Ditto the comments w.r.t. the 307.Fl r 308option, but using the 309.Dq "fragments dropped due to timeout" 310value on the server instead of the client. 311Note that both the 312.Fl r 313and 314.Fl w 315options should only be used as a last ditch effort at improving performance 316when mounting servers that do not support TCP mounts. 317.It Fl x 318Set the retransmit timeout count for soft mounts to the specified value. 319.El 320.Sh SEE ALSO 321.Xr mount 2 , 322.Xr unmount 2 , 323.Xr fstab 5 , 324.Xr mount 8 , 325.Xr nfsd 8 , 326.Xr nfsiod 8 , 327.Xr showmount 8 328.Sh BUGS 329Due to the way that Sun RPC is implemented on top of UDP (unreliable datagram) 330transport, tuning such mounts is really a black art that can only be expected 331to have limited success. 332For clients mounting servers that are not on the same 333LAN cable or that tend to be overloaded, 334TCP transport is strongly recommended, 335but unfortunately this is restricted to mostly 336.Bx 4.4 337servers. 338