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.It noinet4 231.It noinet6 232Disables AF_INET or AF_INET6 connections. Useful for hosts that have 233both an A record and an AAAA record for the same name. 234.El 235.Pp 236.Bl -tag -width "dumbtimerXX" 237\fBHistoric \&-o options\fR 238.Pp 239Use of these options is deprecated, they are only mentioned here for 240compatibility with historic versions of 241.Nm . 242.It bg 243Same as 244.Fl b . 245.It conn 246Same as not specifying 247.Fl c . 248.It dumbtimer 249Same as 250.Fl d . 251.It intr 252Same as 253.Fl i . 254.It lockd 255Same as not specifying 256.Fl L . 257.It nfsv2 258Same as 259.Fl 2 . 260.It nfsv3 261Same as 262.Fl 3 . 263.It rdirplus 264Same as 265.Fl l . 266.It mntudp 267Same as 268.Fl U . 269.It resvport 270Same as 271.Fl P . 272.It seqpacket 273Same as 274.Fl p . 275.It soft 276Same as 277.Fl s . 278.It tcp 279Same as 280.Fl T . 281.El 282.It Fl r 283Set the read data size to the specified value. 284It should normally be a power of 2 greater than or equal to 1024. 285This should be used for UDP mounts when the 286.Dq "fragments dropped due to timeout" 287value is getting large while actively using a mount point. 288(Use 289.Xr netstat 1 290with the 291.Fl s 292option to see what the 293.Dq "fragments dropped due to timeout" 294value is.) 295See the 296.Fl w 297option as well. 298.It Fl s 299A soft mount, which implies that file system calls will fail 300after \fBRetry\fR round trip timeout intervals. 301.It Fl t 302Set the initial retransmit timeout to the specified value. 303May be useful for fine tuning UDP mounts over internetworks 304with high packet loss rates or an overloaded server. 305Try increasing the interval if 306.Xr nfsstat 1 307shows high retransmit rates while the file system is active or reducing the 308value if there is a low retransmit rate but long response delay observed. 309(Normally, the -d option should be specified when using this option to manually 310tune the timeout 311interval.) 312.It Fl w 313Set the write data size to the specified value. 314Ditto the comments w.r.t. the 315.Fl r 316option, but using the 317.Dq "fragments dropped due to timeout" 318value on the server instead of the client. 319Note that both the 320.Fl r 321and 322.Fl w 323options should only be used as a last ditch effort at improving performance 324when mounting servers that do not support TCP mounts. 325.It Fl x 326Set the retransmit timeout count for soft mounts to the specified value. 327.El 328.Sh SEE ALSO 329.Xr mount 2 , 330.Xr unmount 2 , 331.Xr fstab 5 , 332.Xr mount 8 , 333.Xr nfsd 8 , 334.Xr nfsiod 8 , 335.Xr showmount 8 336.Sh BUGS 337Due to the way that Sun RPC is implemented on top of UDP (unreliable datagram) 338transport, tuning such mounts is really a black art that can only be expected 339to have limited success. 340For clients mounting servers that are not on the same 341LAN cable or that tend to be overloaded, 342TCP transport is strongly recommended, 343but unfortunately this is restricted to mostly 344.Bx 4.4 345servers. 346