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