xref: /freebsd/sbin/mount_nfs/mount_nfs.8 (revision 1a720cbec513210fa2e85c3882741ef2f6dc5f35)
14a4c5285SPeter Wemm.\" Copyright (c) 1992, 1993, 1994, 1995
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
68fae3551SRodney W. Grimes.\" are met:
78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
88fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
108fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
118fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
138fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
148fae3551SRodney W. Grimes.\"    without specific prior written permission.
158fae3551SRodney W. Grimes.\"
168fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
178fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
188fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
198fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
208fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
218fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
228fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
238fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
248fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
258fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
268fae3551SRodney W. Grimes.\" SUCH DAMAGE.
278fae3551SRodney W. Grimes.\"
283ddd961dSBenedict Reuschling.Dd October 8, 2023
298fae3551SRodney W. Grimes.Dt MOUNT_NFS 8
309fe48c6eSRuslan Ermilov.Os
318fae3551SRodney W. Grimes.Sh NAME
328fae3551SRodney W. Grimes.Nm mount_nfs
33a7475cf4SRuslan Ermilov.Nd mount NFS file systems
348fae3551SRodney W. Grimes.Sh SYNOPSIS
357c7fb079SRuslan Ermilov.Nm
3686ce6a83SRobert Watson.Op Fl 23bcdiLlNPsTU
378fae3551SRodney W. Grimes.Op Fl a Ar maxreadahead
388d646af5SRuslan Ermilov.Op Fl D Ar deadthresh
398fae3551SRodney W. Grimes.Op Fl g Ar maxgroups
408d646af5SRuslan Ermilov.Op Fl I Ar readdirsize
418fae3551SRodney W. Grimes.Op Fl o Ar options
428d646af5SRuslan Ermilov.Op Fl R Ar retrycnt
438fae3551SRodney W. Grimes.Op Fl r Ar readsize
448fae3551SRodney W. Grimes.Op Fl t Ar timeout
458fae3551SRodney W. Grimes.Op Fl w Ar writesize
468fae3551SRodney W. Grimes.Op Fl x Ar retrans
47d0353b83SRuslan Ermilov.Ar rhost : Ns Ar path node
488fae3551SRodney W. Grimes.Sh DESCRIPTION
498fae3551SRodney W. GrimesThe
5046fc8f78SPhilippe Charnier.Nm
51e1205e80SPhilippe Charnierutility calls the
520c269d1fSCraig Rodrigues.Xr nmount 2
53a7475cf4SRuslan Ermilovsystem call to prepare and graft a remote NFS file system
54d0353b83SRuslan Ermilov.Pq Ar rhost : Ns Ar path
558fae3551SRodney W. Grimeson to the file system tree at the point
568fae3551SRodney W. Grimes.Ar node .
578fae3551SRodney W. GrimesThis command is normally executed by
588fae3551SRodney W. Grimes.Xr mount 8 .
59547a4dbaSRick MacklemFor NFSv2 and NFSv3,
60547a4dbaSRick Macklemit implements the mount protocol as described in RFC 1094, Appendix A and
61547a4dbaSRick MacklemRFC 1813, Appendix I.
62547a4dbaSRick MacklemFor NFSv4, it uses the NFSv4 protocol as described in RFC 7530, RFC 5661 and
63547a4dbaSRick MacklemRFC 7862.
648fae3551SRodney W. Grimes.Pp
652bc53e11SIan DowseBy default,
662bc53e11SIan Dowse.Nm
672bc53e11SIan Dowsekeeps retrying until the mount succeeds.
682bc53e11SIan DowseThis behaviour is intended for file systems listed in
692bc53e11SIan Dowse.Xr fstab 5
702bc53e11SIan Dowsethat are critical to the boot process.
712bc53e11SIan DowseFor non-critical file systems, the
724b5bc283SCraig Rodrigues.Cm bg
732bc53e11SIan Dowseand
744b5bc283SCraig Rodrigues.Cm retrycnt
754b5bc283SCraig Rodriguesoptions provide mechanisms to prevent the boot process from hanging
762bc53e11SIan Dowseif the server is unavailable.
772bc53e11SIan Dowse.Pp
782bc53e11SIan DowseIf the server becomes unresponsive while an NFS file system is
792bc53e11SIan Dowsemounted, any new or outstanding file operations on that file system
802bc53e11SIan Dowsewill hang uninterruptibly until the server comes back.
812bc53e11SIan DowseTo modify this default behaviour, see the
824b5bc283SCraig Rodrigues.Cm intr
832bc53e11SIan Dowseand
844b5bc283SCraig Rodrigues.Cm soft
854b5bc283SCraig Rodriguesoptions.
862bc53e11SIan Dowse.Pp
878fae3551SRodney W. GrimesThe options are:
888fae3551SRodney W. Grimes.Bl -tag -width indent
894b5bc283SCraig Rodrigues.It Fl o
904b5bc283SCraig RodriguesOptions are specified with a
914b5bc283SCraig Rodrigues.Fl o
924b5bc283SCraig Rodriguesflag followed by a comma separated string of options.
934b5bc283SCraig RodriguesSee the
944b5bc283SCraig Rodrigues.Xr mount 8
954b5bc283SCraig Rodriguesman page for possible options and their meanings.
964b5bc283SCraig RodriguesThe following NFS specific options are also available:
974b5bc283SCraig Rodrigues.Bl -tag -width indent
984b5bc283SCraig Rodrigues.It Cm acregmin Ns = Ns Aq Ar seconds
994b5bc283SCraig Rodrigues.It Cm acregmax Ns = Ns Aq Ar seconds
1004b5bc283SCraig Rodrigues.It Cm acdirmin Ns = Ns Aq Ar seconds
1014b5bc283SCraig Rodrigues.It Cm acdirmax Ns = Ns Aq Ar seconds
1024b5bc283SCraig RodriguesWhen attributes of files are cached, a timeout calculated to determine
1034b5bc283SCraig Rodrigueswhether a given cache entry has expired.
1044b5bc283SCraig RodriguesThese four values determine the upper and lower bounds of the timeouts for
1054b5bc283SCraig Rodrigues.Dq directory
1064b5bc283SCraig Rodriguesattributes and
1074b5bc283SCraig Rodrigues.Dq regular
1084b5bc283SCraig Rodrigues(ie: everything else).
1094b5bc283SCraig RodriguesThe default values are 3 -> 60 seconds
1104b5bc283SCraig Rodriguesfor regular files, and 30 -> 60 seconds for directories.
1114b5bc283SCraig RodriguesThe algorithm to calculate the timeout is based on the age of the file.
1124b5bc283SCraig RodriguesThe older the file,
1134b5bc283SCraig Rodriguesthe longer the cache is considered valid, subject to the limits above.
1145a06ac35SEdward Tomasz Napierala.It Cm actimeo Ns = Ns Aq Ar seconds
1155a06ac35SEdward Tomasz NapieralaSet four cache timeouts above to specified value.
116b54de212SRick Macklem.It Cm allgssname
117b54de212SRick MacklemThis option can be used along with
118b54de212SRick Macklem.Fl o Cm gssname
119b54de212SRick Macklemto specify that all operations should use the host-based initiator
120b54de212SRick Macklemcredential.
121b54de212SRick MacklemThis may be used for clients that run system daemons that need to
122b54de212SRick Macklemaccess files on the NFSv4 mounted volume.
1234b5bc283SCraig Rodrigues.It Cm bg
1244b5bc283SCraig RodriguesIf an initial attempt to contact the server fails, fork off a child to keep
1254b5bc283SCraig Rodriguestrying the mount in the background.
1264b5bc283SCraig RodriguesUseful for
1274b5bc283SCraig Rodrigues.Xr fstab 5 ,
1284b5bc283SCraig Rodrigueswhere the file system mount is not critical to multiuser operation.
12908a8d16cSRick Macklem.It Cm bgnow
13008a8d16cSRick MacklemLike
13108a8d16cSRick Macklem.Cm bg ,
13208a8d16cSRick Macklemfork off a child to keep trying the mount in the background,
13308a8d16cSRick Macklembut do not attempt to mount in the foreground first.
13408a8d16cSRick MacklemThis eliminates a
13508a8d16cSRick Macklem60+ second timeout when the server is not responding.
13608a8d16cSRick MacklemUseful for speeding up the boot process of a client when the server is
13708a8d16cSRick Macklemlikely to be unavailable.
13808a8d16cSRick MacklemThis is often the case for interdependent servers
13908a8d16cSRick Macklemsuch as cross-mounted servers (each of two servers is an NFS client of
14008a8d16cSRick Macklemthe other) and for cluster nodes that must boot before the file servers.
1414b5bc283SCraig Rodrigues.It Cm deadthresh Ns = Ns Aq Ar value
14291196234SPeter WemmSet the
1438fae3551SRodney W. Grimes.Dq "dead server threshold"
14491196234SPeter Wemmto the specified number of round trip timeout intervals before a
14591196234SPeter Wemm.Dq "server not responding"
14691196234SPeter Wemmmessage is displayed.
1474b5bc283SCraig Rodrigues.It Cm dumbtimer
1484b5bc283SCraig RodriguesTurn off the dynamic retransmit timeout estimator.
1494b5bc283SCraig RodriguesThis may be useful for UDP mounts that exhibit high retry rates,
1504b5bc283SCraig Rodriguessince it is possible that the dynamically estimated timeout interval is too
1514b5bc283SCraig Rodriguesshort.
1524b5bc283SCraig Rodrigues.It Cm fg
1534b5bc283SCraig RodriguesSame as not specifying
1544b5bc283SCraig Rodrigues.Cm bg .
155b54de212SRick Macklem.It Cm gssname Ns = Ns Aq Ar service-principal-name
156b54de212SRick MacklemThis option can be used with the KerberosV security flavors for NFSv4 mounts
157b54de212SRick Macklemto specify the
158b54de212SRick Macklem.Dq "service-principal-name"
159b54de212SRick Macklemof a host-based entry in the default
160b54de212SRick Macklemkeytab file that is used for system operations.
161b54de212SRick MacklemIt allows the mount to be performed by
162b54de212SRick Macklem.Dq "root"
163b54de212SRick Macklemand avoids problems with
164b54de212SRick Macklemcached credentials for the system operations expiring.
165b54de212SRick MacklemThe
16661330e49SRick Macklem.Dq "service-principal-name"
167b54de212SRick Macklemshould be specified without instance or domain and is typically
168b54de212SRick Macklem.Dq "host" ,
169b54de212SRick Macklem.Dq "nfs"
170b54de212SRick Macklemor
171d511702bSGordon Bergling.Dq "root" ,
172d511702bSGordon Berglingalthough the form
173d511702bSGordon Bergling.Sm off
174d511702bSGordon Bergling.Aq Ar service
175d511702bSGordon Bergling@
176d511702bSGordon Bergling.Aq Ar fqdn
177d511702bSGordon Bergling.Sm on
178d511702bSGordon Berglingcan also be used if the local system's
179d511702bSGordon Bergling.Xr gethostname 3
180d511702bSGordon Berglingvalue does not match the host-based principal in the keytab.
1814b5bc283SCraig Rodrigues.It Cm hard
1824b5bc283SCraig RodriguesSame as not specifying
1834b5bc283SCraig Rodrigues.Cm soft .
1844b5bc283SCraig Rodrigues.It Cm intr
1854b5bc283SCraig RodriguesMake the mount interruptible, which implies that file system calls that
1864b5bc283SCraig Rodriguesare delayed due to an unresponsive server will fail with EINTR when a
1874b5bc283SCraig Rodriguestermination signal is posted for the process.
1889b436906SRick MacklemTo avoid leaving file locks in an indeterminate state on the NFS
1899b436906SRick Macklemserver, it is recommended that the
1909b436906SRick Macklem.Cm nolockd
1919b436906SRick Macklemoption be used with this option.
1924b5bc283SCraig Rodrigues.It Cm maxgroups Ns = Ns Aq Ar value
1934b5bc283SCraig RodriguesSet the maximum size of the group list for the credentials to the
1944b5bc283SCraig Rodriguesspecified value.
1954b5bc283SCraig RodriguesThis should be used for mounts on old servers that cannot handle a
1964b5bc283SCraig Rodriguesgroup list size of 16, as specified in RFC 1057.
1974b5bc283SCraig RodriguesTry 8, if users in a lot of groups cannot get response from the mount
1984b5bc283SCraig Rodriguespoint.
1994b5bc283SCraig Rodrigues.It Cm mntudp
2004b5bc283SCraig RodriguesForce the mount protocol to use UDP transport, even for TCP NFS mounts.
2014b5bc283SCraig Rodrigues(Necessary for some old
2024b5bc283SCraig Rodrigues.Bx
2034b5bc283SCraig Rodriguesservers.)
2040b17c7beSJohn Baldwin.It Cm nametimeo Ns = Ns Aq Ar value
2050b17c7beSJohn BaldwinOverride the default of NFS_DEFAULT_NAMETIMEO for the timeout (in seconds)
2060b17c7beSJohn Baldwinfor positive name cache entries.
2070b17c7beSJohn BaldwinIf this is set to 0 it disables positive name caching for the mount point.
20830607997SRick Macklem.It Cm negnametimeo Ns = Ns Aq Ar value
20930607997SRick MacklemOverride the default of NFS_DEFAULT_NEGNAMETIMEO for the timeout (in seconds)
2100fcf43f6SAllan Judefor negative name cache entries.
2110fcf43f6SAllan JudeIf this is set to 0 it disables negative name caching for the mount point.
2124488c8c3SRick Macklem.It Cm nconnect Ns = Ns Aq Ar value
2134488c8c3SRick MacklemSpecify the number of TCP connections (1-16) to be used
2144488c8c3SRick Macklemfor an NFS Version 4, minor version 1 or 2 mount.
2154488c8c3SRick MacklemMultiple TCP connections can provide more client to server network
2164488c8c3SRick Macklembandwidth for certain network configurations such as:
2174488c8c3SRick Macklem.Bd -literal
2184488c8c3SRick Macklem- Multiple network interfaces that are aggregated together.
2194488c8c3SRick Macklem- A fast network interface that uses multiple queues.
2204488c8c3SRick Macklem.Ed
2214488c8c3SRick Macklem.sp
2224488c8c3SRick MacklemThe first TCP connection will be used for all RPCs that consist
2234488c8c3SRick Macklementirely of small RPC messages.
2244488c8c3SRick MacklemThe RPCs that can have large RPC messages (Read/Readdir/Write) are
2254488c8c3SRick Macklemdistributed over the additional TCP connections in a round robin
2264488c8c3SRick Macklemfashion.
2274488c8c3SRick MacklemThis option will result in more IP port#s being used.
2284488c8c3SRick MacklemThis option requires the
2294488c8c3SRick Macklem.Cm nfsv4
2304488c8c3SRick Macklemoption.
2317e53f16bSRick MacklemNote that for NFS servers such as AmazonEFS, where each new TCP
2327e53f16bSRick Macklemconnection can connect to a different cluster that maintains lock
2337e53f16bSRick Macklemstate separately, this option cannot be used.
2344b5bc283SCraig Rodrigues.It Cm nfsv2
2354b5bc283SCraig RodriguesUse the NFS Version 2 protocol (the default is to try version 3 first
2364b5bc283SCraig Rodriguesthen version 2).
2374b5bc283SCraig RodriguesNote that NFS version 2 has a file size limit of 2 gigabytes.
2384b5bc283SCraig Rodrigues.It Cm nfsv3
2394b5bc283SCraig RodriguesUse the NFS Version 3 protocol.
240011981fdSRick Macklem.It Cm nfsv4
241011981fdSRick MacklemUse the NFS Version 4 protocol.
24225135859SRick MacklemThis option will force the mount to use
243011981fdSRick MacklemTCP transport.
244b413b035SRick MacklemBy default, the highest minor version of NFS Version 4 that is
245b413b035SRick Macklemsupported by the NFS Version 4 server will be used.
246b413b035SRick MacklemSee the
247b413b035SRick Macklem.Cm minorversion
248b413b035SRick Macklemoption.
249f46bea05SRick MacklemMake sure that all your NFS Version 4 clients have unique
250f46bea05SRick Macklemvalues in
251f46bea05SRick Macklem.Pa /etc/hostid .
2525e70ce7aSRick Macklem.It Cm minorversion Ns = Ns Aq Ar value
253b413b035SRick MacklemUse the specified minor version for a NFS Version 4 mount,
254b413b035SRick Macklemoverriding the default.
255b413b035SRick MacklemThe minor versions supported are 0, 1, and 2.
2565e70ce7aSRick MacklemThis option is only meaningful when used with the
2575e70ce7aSRick Macklem.Cm nfsv4
2585e70ce7aSRick Macklemoption.
25919625f29SRick Macklem.It Cm oneopenown
260547a4dbaSRick MacklemMake a minor version 1 or 2 of the NFS Version 4 protocol mount use a single
261547a4dbaSRick MacklemOpenOwner for all Opens.
26219625f29SRick MacklemThis may be useful for a server with a very low limit on OpenOwners, such as
26319625f29SRick MacklemAmazonEFS.
264448de00dSRick MacklemIt may be required when an accumulation of NFS version 4 Opens occurs,
265448de00dSRick Macklemas indicated by the
266448de00dSRick Macklem.Dq Opens
267448de00dSRick Macklemcount displayed by
268b413b035SRick Macklem.Xr nfsstat 1
269448de00dSRick Macklemwith the
270448de00dSRick Macklem.Fl c
271448de00dSRick Macklemand
272448de00dSRick Macklem.Fl E
273448de00dSRick Macklemcommand-line options.
274448de00dSRick MacklemA common case for an accumulation of Opens is a shared library within
275448de00dSRick Macklemthe NFS mount that is used by several
276448de00dSRick Macklemprocesses, where at least one of these processes is always running.
27700c8b28cSRick MacklemThis option cannot be used for an NFS Version 4, minor version 0 mount.
27819625f29SRick MacklemIt may not work correctly when Delegations are being issued by a server,
27919625f29SRick Macklembut note that the AmazonEFS server does not issued delegations at this time.
28000c8b28cSRick MacklemThis option is only meaningful when used with the
28100c8b28cSRick Macklem.Cm nfsv4
282b413b035SRick Macklemoption.
2835e70ce7aSRick Macklem.It Cm pnfs
284547a4dbaSRick MacklemEnable support for parallel NFS (pNFS) for minor version 1 or 2 of the
2855e70ce7aSRick MacklemNFS Version 4 protocol.
2865e70ce7aSRick MacklemThis option is only meaningful when used with the
287b413b035SRick Macklem.Cm nfsv4
2885e70ce7aSRick Macklemoption.
2895a06ac35SEdward Tomasz Napierala.It Cm noac
2905a06ac35SEdward Tomasz NapieralaDisable attribute caching.
2914b5bc283SCraig Rodrigues.It Cm noconn
2924b5bc283SCraig RodriguesFor UDP mount points, do not do a
2934b5bc283SCraig Rodrigues.Xr connect 2 .
2944b5bc283SCraig RodriguesThis must be used if the server does not reply to requests from the standard
2954b5bc283SCraig RodriguesNFS port number 2049 or replies to requests using a different IP address
2964b5bc283SCraig Rodrigues(which can occur if the server is multi-homed).
2974b5bc283SCraig RodriguesSetting the
2984b5bc283SCraig Rodrigues.Va vfs.nfs.nfs_ip_paranoia
2994b5bc283SCraig Rodriguessysctl to 0 will make this option the default.
300e2f2b370SRuslan Ermilov.It Cm nocto
301e2f2b370SRuslan ErmilovNormally, NFS clients maintain the close-to-open cache coherency.
302e2f2b370SRuslan ErmilovThis works by flushing at close time and checking at open time.
303e2f2b370SRuslan ErmilovChecking at open time is implemented by getting attributes from
304e2f2b370SRuslan Ermilovthe server and purging the data cache if they do not match
305e2f2b370SRuslan Ermilovattributes cached by the client.
306e2f2b370SRuslan Ermilov.Pp
307e2f2b370SRuslan ErmilovThis option disables checking at open time.
308e2f2b370SRuslan ErmilovIt may improve performance for read-only mounts,
309e2f2b370SRuslan Ermilovbut should only be used if the data on the server changes rarely.
310e2f2b370SRuslan ErmilovBe sure to understand the consequences before enabling this option.
3114b5bc283SCraig Rodrigues.It Cm noinet4 , noinet6
3124b5bc283SCraig RodriguesDisables
3134b5bc283SCraig Rodrigues.Dv AF_INET
3144b5bc283SCraig Rodriguesor
3154b5bc283SCraig Rodrigues.Dv AF_INET6
3164b5bc283SCraig Rodriguesconnections.
3174b5bc283SCraig RodriguesUseful for hosts that have
3184b5bc283SCraig Rodriguesboth an A record and an AAAA record for the same name.
3194b5bc283SCraig Rodrigues.It Cm nolockd
32013190d87SAlfred PerlsteinDo
32113190d87SAlfred Perlstein.Em not
32213190d87SAlfred Perlsteinforward
32313190d87SAlfred Perlstein.Xr fcntl 2
3249b436906SRick Macklemlocks over the wire via the NLM protocol for NFSv3 mounts
3259b436906SRick Macklemor via the NFSv4 protocol for NFSv4 mounts.
32613190d87SAlfred PerlsteinAll locks will be local and not seen by the server
3279b436906SRick Macklemand likewise not seen by other NFS clients for NFSv3 or NFSv4 mounts.
328a7475cf4SRuslan ErmilovThis removes the need to run the
32913190d87SAlfred Perlstein.Xr rpcbind 8
33013190d87SAlfred Perlsteinservice and the
33113190d87SAlfred Perlstein.Xr rpc.statd 8
33213190d87SAlfred Perlsteinand
33313190d87SAlfred Perlstein.Xr rpc.lockd 8
3349b436906SRick Macklemservers on the client for NFSv3 mounts.
3353fd0605eSAlfred PerlsteinNote that this option will only be honored when performing the
3363fd0605eSAlfred Perlsteininitial mount, it will be silently ignored if used while updating
3373fd0605eSAlfred Perlsteinthe mount options.
3389b436906SRick MacklemAlso, note that NFSv4 mounts do not use these daemons.
3399b436906SRick MacklemThe NFSv4 protocol handles locks,
3409b436906SRick Macklemunless this option is specified.
341a8e2866cSRick Macklem.It Cm noncontigwr
342a8e2866cSRick MacklemThis mount option allows the NFS client to
343a8e2866cSRick Macklemcombine non-contiguous byte ranges being written
344a8e2866cSRick Macklemsuch that the dirty byte range becomes a superset of the bytes
345a8e2866cSRick Macklemthat are dirty.
346a8e2866cSRick MacklemThis reduces the number of writes significantly for software
347a8e2866cSRick Macklembuilds.
3480fcf43f6SAllan JudeThe merging of byte ranges is not done if the file has been file
349a8e2866cSRick Macklemlocked, since most applications modifying a file from multiple
350a8e2866cSRick Macklemclients will use file locking.
351a8e2866cSRick MacklemAs such, this option could result in a corrupted file for the
352a8e2866cSRick Macklemrare case of an application modifying the file from multiple
353a8e2866cSRick Macklemclients concurrently without using file locking.
354011981fdSRick Macklem.It Cm principal
355011981fdSRick MacklemFor the RPCSEC_GSS security flavors, such as krb5, krb5i and krb5p,
356011981fdSRick Macklemthis option sets the name of the host based principal name expected
3570fcf43f6SAllan Judeby the server.
3580fcf43f6SAllan JudeThis option overrides the default, which will be ``nfs@<server-fqdn>''
3590fcf43f6SAllan Judeand should normally be sufficient.
3604b5bc283SCraig Rodrigues.It Cm noresvport
361cc75b131SJoerg WunschDo
362cc75b131SJoerg Wunsch.Em not
363cc75b131SJoerg Wunschuse a reserved socket port number (see below).
3644b5bc283SCraig Rodrigues.It Cm port Ns = Ns Aq Ar port_number
3654b5bc283SCraig RodriguesUse specified port number for NFS requests.
3664b5bc283SCraig RodriguesThe default is to query the portmapper for the NFS port.
3675a06ac35SEdward Tomasz Napierala.It Cm proto Ns = Ns Aq Ar protocol
3685a06ac35SEdward Tomasz NapieralaSpecify transport protocol version to use.
3695a06ac35SEdward Tomasz NapieralaCurrently, they are:
3705a06ac35SEdward Tomasz Napierala.Bd -literal
3715a06ac35SEdward Tomasz Napieralaudp -   Use UDP over IPv4
3725a06ac35SEdward Tomasz Napieralatcp -   Use TCP over IPv4
3735a06ac35SEdward Tomasz Napieralaudp6 -  Use UDP over IPv6
3745a06ac35SEdward Tomasz Napieralatcp6 -  Use TCP over IPv6
3755a06ac35SEdward Tomasz Napierala.Ed
3764b5bc283SCraig Rodrigues.It Cm rdirplus
377011981fdSRick MacklemUsed with NFSV3 to specify that the \fBReaddirPlus\fR RPC should
3788fae3551SRodney W. Grimesbe used.
379011981fdSRick MacklemFor NFSV4, setting this option has a similar effect, in that it will make
380011981fdSRick Macklemthe Readdir Operation get more attributes.
3818fae3551SRodney W. GrimesThis option reduces RPC traffic for cases such as
3828fae3551SRodney W. Grimes.Dq "ls -l" ,
383a62dc406SDoug Rabsonbut tends to flood the attribute and name caches with prefetched entries.
384ef8f7ac9SSheldon HearnTry this option and see whether performance improves or degrades.
385ef8f7ac9SSheldon HearnProbably
386a62dc406SDoug Rabsonmost useful for client to server network interconnects with a large bandwidth
387a62dc406SDoug Rabsontimes delay product.
3884b5bc283SCraig Rodrigues.It Cm readahead Ns = Ns Aq Ar value
3894b5bc283SCraig RodriguesSet the read-ahead count to the specified value.
3904b5bc283SCraig RodriguesThis may be in the range of 0 - 4, and determines how many blocks
3914b5bc283SCraig Rodrigueswill be read ahead when a large file is being read sequentially.
3924b5bc283SCraig RodriguesTrying a value greater than 1 for this is suggested for
3934b5bc283SCraig Rodriguesmounts with a large bandwidth * delay product.
3944b5bc283SCraig Rodrigues.It Cm readdirsize Ns = Ns Aq Ar value
3954b5bc283SCraig RodriguesSet the readdir read size to the specified value.
3964b5bc283SCraig RodriguesThe value should normally
3974b5bc283SCraig Rodriguesbe a multiple of
3984b5bc283SCraig Rodrigues.Dv DIRBLKSIZ
3994b5bc283SCraig Rodriguesthat is <= the read size for the mount.
400a7475cf4SRuslan Ermilov.It Cm resvport
4014b5bc283SCraig RodriguesUse a reserved socket port number.
4024b5bc283SCraig RodriguesThis flag is obsolete, and only retained for compatibility reasons.
4034b5bc283SCraig RodriguesReserved port numbers are used by default now.
4044b5bc283SCraig Rodrigues(For the rare case where the client has a trusted root account
4054b5bc283SCraig Rodriguesbut untrustworthy users and the network cables are in secure areas this does
4064b5bc283SCraig Rodrigueshelp, but for normal desktop clients this does not apply.)
4074b5bc283SCraig Rodrigues.It Cm retrans Ns = Ns Aq Ar value
4084b5bc283SCraig RodriguesSet the retransmit timeout count for soft mounts to the specified value.
4094b5bc283SCraig Rodrigues.It Cm retrycnt Ns = Ns Aq Ar count
4104b5bc283SCraig RodriguesSet the mount retry count to the specified value.
4114b5bc283SCraig RodriguesThe default is a retry count of zero, which means to keep retrying
4124b5bc283SCraig Rodriguesforever.
4134b5bc283SCraig RodriguesThere is a 60 second delay between each attempt.
4144b5bc283SCraig Rodrigues.It Cm rsize Ns = Ns Aq Ar value
4158fae3551SRodney W. GrimesSet the read data size to the specified value.
416a62dc406SDoug RabsonIt should normally be a power of 2 greater than or equal to 1024.
4178fae3551SRodney W. GrimesThis should be used for UDP mounts when the
4188fae3551SRodney W. Grimes.Dq "fragments dropped due to timeout"
4198fae3551SRodney W. Grimesvalue is getting large while actively using a mount point.
4208fae3551SRodney W. Grimes(Use
4218fae3551SRodney W. Grimes.Xr netstat 1
4228fae3551SRodney W. Grimeswith the
4238fae3551SRodney W. Grimes.Fl s
4248fae3551SRodney W. Grimesoption to see what the
4258fae3551SRodney W. Grimes.Dq "fragments dropped due to timeout"
4268fae3551SRodney W. Grimesvalue is.)
427011981fdSRick Macklem.It Cm sec Ns = Ns Aq Ar flavor
428011981fdSRick MacklemThis option specifies what security flavor should be used for the mount.
429011981fdSRick MacklemCurrently, they are:
430011981fdSRick Macklem.Bd -literal
431011981fdSRick Macklemkrb5 -  Use KerberosV authentication
432011981fdSRick Macklemkrb5i - Use KerberosV authentication and
433011981fdSRick Macklem        apply integrity checksums to RPCs
434011981fdSRick Macklemkrb5p - Use KerberosV authentication and
435011981fdSRick Macklem        encrypt the RPC data
436011981fdSRick Macklemsys -   The default AUTH_SYS, which uses a
437011981fdSRick Macklem        uid + gid list authenticator
438011981fdSRick Macklem.Ed
4394b5bc283SCraig Rodrigues.It Cm soft
4408fae3551SRodney W. GrimesA soft mount, which implies that file system calls will fail
441a7475cf4SRuslan Ermilovafter
442a7475cf4SRuslan Ermilov.Ar retrycnt
443a7475cf4SRuslan Ermilovround trip timeout intervals.
44461330e49SRick Macklem.It Cm syskrb5
44561330e49SRick MacklemThis option specifies that a KerberosV NFSv4 minor version 1 or 2 mount
44661330e49SRick Macklemuses AUTH_SYS for system operations.
44761330e49SRick MacklemUsing this option avoids the need for a KerberosV mount to have a
44861330e49SRick Macklemhost-based principal entry in the default keytab file
44961330e49SRick Macklem(no
45061330e49SRick Macklem.Cm gssname
45161330e49SRick Macklemoption) or a requirement for the user doing the mount to have a
45261330e49SRick Macklemvalid KerberosV ticket granting ticket (TGT) when the mount is done.
45361330e49SRick MacklemThis option is intended to be used with the
45461330e49SRick Macklem.Cm sec Ns = Ns krb5
45561330e49SRick Macklemand
45661330e49SRick Macklem.Cm tls
45761330e49SRick Macklemoptions and can only be used for
45861330e49SRick MacklemNFSv4 mounts with minor version 1 or 2.
4594b5bc283SCraig Rodrigues.It Cm tcp
4604b5bc283SCraig RodriguesUse TCP transport.
4614b5bc283SCraig RodriguesThis is the default option, as it provides for increased reliability on both
4624b5bc283SCraig RodriguesLAN and WAN configurations compared to UDP.
4634b5bc283SCraig RodriguesSome old NFS servers do not support this method; UDP mounts may be required
4644b5bc283SCraig Rodriguesfor interoperability.
4654b5bc283SCraig Rodrigues.It Cm timeout Ns = Ns Aq Ar value
4662a9b29b3SEdward Tomasz NapieralaSet the initial retransmit timeout to the specified value,
4672a9b29b3SEdward Tomasz Napieralaexpressed in tenths of a second.
4688fae3551SRodney W. GrimesMay be useful for fine tuning UDP mounts over internetworks
4698fae3551SRodney W. Grimeswith high packet loss rates or an overloaded server.
4708fae3551SRodney W. GrimesTry increasing the interval if
4718fae3551SRodney W. Grimes.Xr nfsstat 1
4728fae3551SRodney W. Grimesshows high retransmit rates while the file system is active or reducing the
4738fae3551SRodney W. Grimesvalue if there is a low retransmit rate but long response delay observed.
474a7475cf4SRuslan Ermilov(Normally, the
4754b5bc283SCraig Rodrigues.Cm dumbtimer
476a7475cf4SRuslan Ermilovoption should be specified when using this option to manually
477a62dc406SDoug Rabsontune the timeout
478a62dc406SDoug Rabsoninterval.)
4795a06ac35SEdward Tomasz Napierala.It Cm timeo Ns = Ns Aq Ar value
4805a06ac35SEdward Tomasz NapieralaAlias for
4815a06ac35SEdward Tomasz Napierala.Cm timeout .
48204914a21SRick Macklem.It Cm tls
48304914a21SRick MacklemThis option specifies that the connection to the server must use TLS
4840083eef3SRick Macklemper RFC 9289.
48504914a21SRick MacklemTLS is only supported for TCP connections and the
48604914a21SRick Macklem.Xr rpc.tlsclntd 8
48704914a21SRick Macklemdaemon must be running for an NFS over TCP connection to use TLS.
48879302a63SRick Macklem.It Cm tlscertname Ns = Ns Aq Ar name
48979302a63SRick MacklemThis option specifies the name of an alternate certificate to be
49079302a63SRick Macklempresented to the NFS server during TLS handshake.
49179302a63SRick MacklemThe default certificate file names are
49279302a63SRick Macklem.Dq cert.pem
49379302a63SRick Macklemand
49479302a63SRick Macklem.Dq certkey.pem .
49579302a63SRick MacklemWhen this option is specified,
49679302a63SRick Macklem.Ar name
49779302a63SRick Macklemreplaces
49879302a63SRick Macklem.Dq cert
49979302a63SRick Macklemin the above file names.
50079302a63SRick MacklemFor example, if the value of
50179302a63SRick Macklem.Ar name
50279302a63SRick Macklemis specified as
50379302a63SRick Macklem.Dq other
50479302a63SRick Macklemthe certificate file names to be used will be
50579302a63SRick Macklem.Dq other.pem
50679302a63SRick Macklemand
50779302a63SRick Macklem.Dq otherkey.pem .
50879302a63SRick MacklemThese files are stored in
50979302a63SRick Macklem.Pa /etc/rpc.tlsclntd
51079302a63SRick Macklemby default.
51179302a63SRick MacklemThis option is only meaningful when used with the
51279302a63SRick Macklem.Cm tls
51379302a63SRick Macklemoption and the
51479302a63SRick Macklem.Xr rpc.tlsclntd 8
51579302a63SRick Macklemis running with the
51679302a63SRick Macklem.Fl m
51779302a63SRick Macklemcommand line flag set.
5184b5bc283SCraig Rodrigues.It Cm udp
5194b5bc283SCraig RodriguesUse UDP transport.
520528c159fSBjoern A. Zeeb.It Cm vers Ns = Ns Aq Ar vers_number
521528c159fSBjoern A. ZeebUse the specified version number for NFS requests.
522528c159fSBjoern A. ZeebSee the
523528c159fSBjoern A. Zeeb.Cm nfsv2 ,
524528c159fSBjoern A. Zeeb.Cm nfsv3 ,
525528c159fSBjoern A. Zeeband
526528c159fSBjoern A. Zeeb.Cm nfsv4
527528c159fSBjoern A. Zeeboptions for details.
528840fb1c0SJohn Baldwin.It Cm wcommitsize Ns = Ns Aq Ar value
529840fb1c0SJohn BaldwinSet the maximum pending write commit size to the specified value.
530840fb1c0SJohn BaldwinThis determines the maximum amount of pending write data that the NFS
531840fb1c0SJohn Baldwinclient is willing to cache for each file.
5324b5bc283SCraig Rodrigues.It Cm wsize Ns = Ns Aq Ar value
5338fae3551SRodney W. GrimesSet the write data size to the specified value.
5349806e231SRuslan ErmilovDitto the comments w.r.t.\& the
5354b5bc283SCraig Rodrigues.Cm rsize
5368fae3551SRodney W. Grimesoption, but using the
5378fae3551SRodney W. Grimes.Dq "fragments dropped due to timeout"
5388fae3551SRodney W. Grimesvalue on the server instead of the client.
5398fae3551SRodney W. GrimesNote that both the
5404b5bc283SCraig Rodrigues.Cm rsize
5418fae3551SRodney W. Grimesand
5424b5bc283SCraig Rodrigues.Cm wsize
5438fae3551SRodney W. Grimesoptions should only be used as a last ditch effort at improving performance
5448fae3551SRodney W. Grimeswhen mounting servers that do not support TCP mounts.
5454b5bc283SCraig Rodrigues.El
5464b5bc283SCraig Rodrigues.El
547c2a9d237SGordon Bergling.Sh IMPLEMENTATION NOTES
548c2a9d237SGordon BerglingWhen neither the
549c2a9d237SGordon Bergling.Cm rsize
550c2a9d237SGordon Berglingnor
551c2a9d237SGordon Bergling.Cm wsize
552c2a9d237SGordon Berglingoptions are specified, the I/O size will be set to the largest value
553c2a9d237SGordon Berglingsupported by both the NFS client and server.
554c2a9d237SGordon BerglingThe largest value supported by the NFS client is defined by
555c2a9d237SGordon Berglingthe tunable
556c2a9d237SGordon Bergling.Cd vfs.maxbcachebuf
557c2a9d237SGordon Berglingwhich can be set to a power of two up to
558c2a9d237SGordon Bergling.Cd kern.maxphys .
559c2a9d237SGordon Bergling.Pp
560c2a9d237SGordon BerglingThe
561c2a9d237SGordon Bergling.Xr nfsstat 1
562c2a9d237SGordon Berglingcommand with the
563c2a9d237SGordon Bergling.Ic -m
564c2a9d237SGordon Berglingcommand line option will show what
565c2a9d237SGordon Bergling.Nm
566c2a9d237SGordon Berglingoption settings are actually in use for the mount.
5674b5bc283SCraig Rodrigues.Sh COMPATIBILITY
5684b5bc283SCraig RodriguesThe following command line flags are equivalent to
5694b5bc283SCraig Rodrigues.Fl o
5704b5bc283SCraig Rodriguesnamed options and are supported for compatibility with older
5714b5bc283SCraig Rodriguesinstallations.
5724b5bc283SCraig Rodrigues.Bl -tag -width indent
5734b5bc283SCraig Rodrigues.It Fl 2
5744b5bc283SCraig RodriguesSame as
5754b5bc283SCraig Rodrigues.Fl o Cm nfsv2
5764b5bc283SCraig Rodrigues.It Fl 3
5774b5bc283SCraig RodriguesSame as
5784b5bc283SCraig Rodrigues.Fl o Cm nfsv3
5794b5bc283SCraig Rodrigues.It Fl D
5804b5bc283SCraig RodriguesSame as
5814b5bc283SCraig Rodrigues.Fl o Cm deadthresh
5824b5bc283SCraig Rodrigues.It Fl I
5834b5bc283SCraig RodriguesSame as
5844b5bc283SCraig Rodrigues.Fl o Cm readdirsize Ns = Ns Aq Ar value
5854b5bc283SCraig Rodrigues.It Fl L
5864b5bc283SCraig RodriguesSame as
5874b5bc283SCraig Rodrigues.Fl o Cm nolockd
5884b5bc283SCraig Rodrigues.It Fl N
5894b5bc283SCraig RodriguesSame as
5904b5bc283SCraig Rodrigues.Fl o Cm noresvport
5914b5bc283SCraig Rodrigues.It Fl P
5924b5bc283SCraig RodriguesUse a reserved socket port number.
5934b5bc283SCraig RodriguesThis flag is obsolete, and only retained for compatibility reasons.
5944b5bc283SCraig Rodrigues(For the rare case where the client has a trusted root account
5954b5bc283SCraig Rodriguesbut untrustworthy users and the network cables are in secure areas this does
5964b5bc283SCraig Rodrigueshelp, but for normal desktop clients this does not apply.)
5974b5bc283SCraig Rodrigues.It Fl R
5984b5bc283SCraig RodriguesSame as
5994b5bc283SCraig Rodrigues.Fl o Cm retrycnt Ns = Ns Aq Ar value
6004b5bc283SCraig Rodrigues.It Fl T
6014b5bc283SCraig RodriguesSame as
6024b5bc283SCraig Rodrigues.Fl o Cm tcp
6034b5bc283SCraig Rodrigues.It Fl U
6044b5bc283SCraig RodriguesSame as
6054b5bc283SCraig Rodrigues.Fl o Cm mntudp
6064b5bc283SCraig Rodrigues.It Fl a
6074b5bc283SCraig RodriguesSame as
6084b5bc283SCraig Rodrigues.Fl o Cm readahead Ns = Ns Aq Ar value
6094b5bc283SCraig Rodrigues.It Fl b
6104b5bc283SCraig RodriguesSame as
6114b5bc283SCraig Rodrigues.Fl o Cm bg
6124b5bc283SCraig Rodrigues.It Fl c
6134b5bc283SCraig RodriguesSame as
6144b5bc283SCraig Rodrigues.Fl o Cm noconn
6154b5bc283SCraig Rodrigues.It Fl d
6164b5bc283SCraig RodriguesSame as
6174b5bc283SCraig Rodrigues.Fl o Cm dumbtimer
6184b5bc283SCraig Rodrigues.It Fl g
6194b5bc283SCraig RodriguesSame as
6204b5bc283SCraig Rodrigues.Fl o Cm maxgroups
6214b5bc283SCraig Rodrigues.It Fl i
6224b5bc283SCraig RodriguesSame as
6234b5bc283SCraig Rodrigues.Fl o Cm intr
6244b5bc283SCraig Rodrigues.It Fl l
6254b5bc283SCraig RodriguesSame as
6264b5bc283SCraig Rodrigues.Fl o Cm rdirplus
6274b5bc283SCraig Rodrigues.It Fl r
6284b5bc283SCraig RodriguesSame as
6294b5bc283SCraig Rodrigues.Fl o Cm rsize Ns = Ns Aq Ar value
6304b5bc283SCraig Rodrigues.It Fl s
6314b5bc283SCraig RodriguesSame as
6324b5bc283SCraig Rodrigues.Fl o Cm soft
6334b5bc283SCraig Rodrigues.It Fl t
6344b5bc283SCraig RodriguesSame as
6354b5bc283SCraig Rodrigues.Fl o Cm retransmit Ns = Ns Aq Ar value
6363ddd961dSBenedict Reuschling(deprecated)
6374b5bc283SCraig Rodrigues.It Fl w
6384b5bc283SCraig RodriguesSame as
6394b5bc283SCraig Rodrigues.Fl o Cm wsize Ns = Ns Aq Ar value
6408fae3551SRodney W. Grimes.It Fl x
6414b5bc283SCraig RodriguesSame as
6424b5bc283SCraig Rodrigues.Fl o Cm retrans Ns = Ns Aq Ar value
6438fae3551SRodney W. Grimes.El
644528c159fSBjoern A. Zeeb.Pp
645528c159fSBjoern A. ZeebThe following
646528c159fSBjoern A. Zeeb.Fl o
647528c159fSBjoern A. Zeebnamed options are equivalent to other
648528c159fSBjoern A. Zeeb.Fl o
649528c159fSBjoern A. Zeebnamed options and are supported for compatibility with other
650528c159fSBjoern A. Zeeboperating systems (e.g., Linux, Solaris, and OSX) to ease usage of
651*1a720cbeSAlexander Ziaee.Xr autofs 4
652528c159fSBjoern A. Zeebsupport.
653528c159fSBjoern A. Zeeb.Bl -tag -width indent
654528c159fSBjoern A. Zeeb.It Fl o Cm vers Ns = Ns 2
655528c159fSBjoern A. ZeebSame as
656528c159fSBjoern A. Zeeb.Fl o Cm nfsv2
657528c159fSBjoern A. Zeeb.It Fl o Cm vers Ns = Ns 3
658528c159fSBjoern A. ZeebSame as
659528c159fSBjoern A. Zeeb.Fl o Cm nfsv3
660528c159fSBjoern A. Zeeb.It Fl o Cm vers Ns = Ns 4
661528c159fSBjoern A. ZeebSame as
662528c159fSBjoern A. Zeeb.Fl o Cm nfsv4
663528c159fSBjoern A. Zeeb.El
6648fae3551SRodney W. Grimes.Sh SEE ALSO
6654488c8c3SRick Macklem.Xr nfsstat 1 ,
6660c269d1fSCraig Rodrigues.Xr nmount 2 ,
6678fae3551SRodney W. Grimes.Xr unmount 2 ,
6684488c8c3SRick Macklem.Xr lagg 4 ,
669011981fdSRick Macklem.Xr nfsv4 4 ,
6708fae3551SRodney W. Grimes.Xr fstab 5 ,
671011981fdSRick Macklem.Xr gssd 8 ,
6722a2d4405SMatthew Dillon.Xr mount 8 ,
673ffc717e2SSheldon Hearn.Xr nfsd 8 ,
674893d2b85SSheldon Hearn.Xr nfsiod 8 ,
67504914a21SRick Macklem.Xr rpc.tlsclntd 8 ,
676893d2b85SSheldon Hearn.Xr showmount 8
6770fcf43f6SAllan Jude.Sh HISTORY
6780fcf43f6SAllan JudeA version of the
6790fcf43f6SAllan Jude.Nm
6800fcf43f6SAllan Judeutility appeared in
6810fcf43f6SAllan Jude.Bx 4.4 .
682011981fdSRick Macklem.Sh BUGS
6839b436906SRick MacklemSince NFSv4 performs open/lock operations that have their ordering strictly
684011981fdSRick Macklemenforced by the server, the options
685011981fdSRick Macklem.Cm intr
686011981fdSRick Macklemand
687011981fdSRick Macklem.Cm soft
688011981fdSRick Macklemcannot be safely used.
6899b436906SRick MacklemFor NFSv4 minor version 1 or 2 mounts, the ordering is done
6909b436906SRick Macklemvia session slots and the NFSv4 client now handles broken session slots
6919b436906SRick Macklemfairly well.
6929b436906SRick MacklemAs such, if the
6939b436906SRick Macklem.Cm nolockd
6949b436906SRick Macklemoption is used along with
6959b436906SRick Macklem.Cm intr
6969b436906SRick Macklemand/or
6979b436906SRick Macklem.Cm soft ,
6989b436906SRick Mackleman NFSv4 minor version 1 or 2 mount
6999b436906SRick Macklemshould work fairly well, although still not completely correctly.
7009b436906SRick MacklemFor NFSv4 minor version 0 mounts,
701011981fdSRick Macklem.Cm hard
7029b436906SRick Macklemmounts without the
7039b436906SRick Macklem.Cm intr
7049b436906SRick Macklemmount option is strongly recommended.
705