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