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 if the server does not reply to requests from the standard 176NFS port number 2049 or replies to requests using a different IP address 177(which can occur if the server is multi-homed). 178Setting the 179.Va vfs.nfs.nfs_ip_paranoia 180sysctl to 0 will make this option the default. 181.It Fl d 182Turn off the dynamic retransmit timeout estimator. 183This may be useful for UDP mounts that exhibit high retry rates, 184since it is possible that the dynamically estimated timeout interval is too 185short. 186.It Fl g 187Set the maximum size of the group list for the credentials to the 188specified value. 189This should be used for mounts on old servers that cannot handle a 190group list size of 16, as specified in RFC 1057. 191Try 8, if users in a lot of groups cannot get response from the mount 192point. 193.It Fl i 194Make the mount interruptible, which implies that file system calls that 195are delayed due to an unresponsive server will fail with EINTR when a 196termination signal is posted for the process. 197.It Fl l 198Used with NQNFS and NFSV3 to specify that the \fBReaddirPlus\fR RPC should 199be used. 200This option reduces RPC traffic for cases such as 201.Dq "ls -l" , 202but tends to flood the attribute and name caches with prefetched entries. 203Try this option and see whether performance improves or degrades. 204Probably 205most useful for client to server network interconnects with a large bandwidth 206times delay product. 207.It Fl o 208Options are specified with a 209.Fl o 210flag followed by a comma separated string of options. 211See the 212.Xr mount 8 213man page for possible options and their meanings. 214The following NFS specific option is also available: 215.Bl -tag -width indent 216.It port=<port_number> 217Use specified port number for NFS requests. 218The default is to query the portmapper for the NFS port. 219.It acregmin=<seconds> 220.It acregmax=<seconds> 221.It acdirmin=<seconds> 222.It acdirmax=<seconds> 223When attributes of files are cached, a timeout calculated to determine 224whether a given cache entry has expired. These four values determine the 225upper and lower bounds of the timeouts for ``directory'' attributes and 226``regular'' (ie: everything else). The default values are 3 -> 60 seconds 227for regular files, and 30 -> 60 seconds for directories. The algorithm to 228calculate the timeout is based on the age of the file. The older the file, 229the longer the cache is considered valid, subject to the limits above. 230.El 231.Pp 232.Bl -tag -width "dumbtimerXX" 233\fBHistoric \&-o options\fR 234.Pp 235Use of these options is deprecated, they are only mentioned here for 236compatibility with historic versions of 237.Nm . 238.It bg 239Same as 240.Fl b . 241.It conn 242Same as not specifying 243.Fl c . 244.It dumbtimer 245Same as 246.Fl d . 247.It intr 248Same as 249.Fl i . 250.It lockd 251Same as not specifying 252.Fl L . 253.It nfsv2 254Same as 255.Fl 2 . 256.It nfsv3 257Same as 258.Fl 3 . 259.It rdirplus 260Same as 261.Fl l . 262.It mntudp 263Same as 264.Fl U . 265.It resvport 266Same as 267.Fl P . 268.It seqpacket 269Same as 270.Fl p . 271.It soft 272Same as 273.Fl s . 274.It tcp 275Same as 276.Fl T . 277.El 278.It Fl r 279Set the read data size to the specified value. 280It should normally be a power of 2 greater than or equal to 1024. 281This should be used for UDP mounts when the 282.Dq "fragments dropped due to timeout" 283value is getting large while actively using a mount point. 284(Use 285.Xr netstat 1 286with the 287.Fl s 288option to see what the 289.Dq "fragments dropped due to timeout" 290value is.) 291See the 292.Fl w 293option as well. 294.It Fl s 295A soft mount, which implies that file system calls will fail 296after \fBRetry\fR round trip timeout intervals. 297.It Fl t 298Set the initial retransmit timeout to the specified value. 299May be useful for fine tuning UDP mounts over internetworks 300with high packet loss rates or an overloaded server. 301Try increasing the interval if 302.Xr nfsstat 1 303shows high retransmit rates while the file system is active or reducing the 304value if there is a low retransmit rate but long response delay observed. 305(Normally, the -d option should be specified when using this option to manually 306tune the timeout 307interval.) 308.It Fl w 309Set the write data size to the specified value. 310Ditto the comments w.r.t. the 311.Fl r 312option, but using the 313.Dq "fragments dropped due to timeout" 314value on the server instead of the client. 315Note that both the 316.Fl r 317and 318.Fl w 319options should only be used as a last ditch effort at improving performance 320when mounting servers that do not support TCP mounts. 321.It Fl x 322Set the retransmit timeout count for soft mounts to the specified value. 323.El 324.Sh SEE ALSO 325.Xr mount 2 , 326.Xr unmount 2 , 327.Xr fstab 5 , 328.Xr mount 8 , 329.Xr nfsd 8 , 330.Xr nfsiod 8 , 331.Xr showmount 8 332.Sh BUGS 333Due to the way that Sun RPC is implemented on top of UDP (unreliable datagram) 334transport, tuning such mounts is really a black art that can only be expected 335to have limited success. 336For clients mounting servers that are not on the same 337LAN cable or that tend to be overloaded, 338TCP transport is strongly recommended, 339but unfortunately this is restricted to mostly 340.Bx 4.4 341servers. 342