xref: /freebsd/sbin/mount_nfs/mount_nfs.8 (revision 13190d87546adb8338f93e34c24fb9d99ec688d5)
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.
128fae3551SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
138fae3551SRodney W. Grimes.\"    must display the following acknowledgement:
148fae3551SRodney W. Grimes.\"	This product includes software developed by the University of
158fae3551SRodney W. Grimes.\"	California, Berkeley and its contributors.
168fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
178fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
188fae3551SRodney W. Grimes.\"    without specific prior written permission.
198fae3551SRodney W. Grimes.\"
208fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
218fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
248fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
258fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
268fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
278fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
288fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
298fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
308fae3551SRodney W. Grimes.\" SUCH DAMAGE.
318fae3551SRodney W. Grimes.\"
324a4c5285SPeter Wemm.\"	@(#)mount_nfs.8	8.3 (Berkeley) 3/29/95
338fae3551SRodney W. Grimes.\"
347f3dea24SPeter Wemm.\" $FreeBSD$
35f9dc1926SJoerg Wunsch.\""
364a4c5285SPeter Wemm.Dd March 29, 1995
378fae3551SRodney W. Grimes.Dt MOUNT_NFS 8
389fe48c6eSRuslan Ermilov.Os
398fae3551SRodney W. Grimes.Sh NAME
408fae3551SRodney W. Grimes.Nm mount_nfs
418fae3551SRodney W. Grimes.Nd mount nfs file systems
428fae3551SRodney W. Grimes.Sh SYNOPSIS
437c7fb079SRuslan Ermilov.Nm
4413190d87SAlfred Perlstein.Op Fl 23NPTUbcdiLls
458fae3551SRodney W. Grimes.Op Fl D Ar deadthresh
46a62dc406SDoug Rabson.Op Fl I Ar readdirsize
478fae3551SRodney W. Grimes.Op Fl R Ar retrycnt
488fae3551SRodney W. Grimes.Op Fl a Ar maxreadahead
498fae3551SRodney W. Grimes.Op Fl g Ar maxgroups
508fae3551SRodney W. Grimes.Op Fl o Ar options
518fae3551SRodney W. Grimes.Op Fl r Ar readsize
528fae3551SRodney W. Grimes.Op Fl t Ar timeout
538fae3551SRodney W. Grimes.Op Fl w Ar writesize
548fae3551SRodney W. Grimes.Op Fl x Ar retrans
55d0353b83SRuslan Ermilov.Ar rhost : Ns Ar path node
568fae3551SRodney W. Grimes.Sh DESCRIPTION
578fae3551SRodney W. GrimesThe
5846fc8f78SPhilippe Charnier.Nm
598fae3551SRodney W. Grimescommand
608fae3551SRodney W. Grimescalls the
618fae3551SRodney W. Grimes.Xr mount 2
62d0353b83SRuslan Ermilovsystem call to prepare and graft a remote nfs file system
63d0353b83SRuslan Ermilov.Pq Ar rhost : Ns Ar path
648fae3551SRodney W. Grimeson to the file system tree at the point
658fae3551SRodney W. Grimes.Ar node .
668fae3551SRodney W. GrimesThis command is normally executed by
678fae3551SRodney W. Grimes.Xr mount 8 .
68a62dc406SDoug RabsonIt implements the mount protocol as described in RFC 1094, Appendix A and
69a62dc406SDoug Rabson.%T "NFS: Network File System Version 3 Protocol Specification" ,
70a62dc406SDoug RabsonAppendix I.
718fae3551SRodney W. Grimes.Pp
722bc53e11SIan DowseBy default,
732bc53e11SIan Dowse.Nm
742bc53e11SIan Dowsekeeps retrying until the mount succeeds.
752bc53e11SIan DowseThis behaviour is intended for filesystems listed in
762bc53e11SIan Dowse.Xr fstab 5
772bc53e11SIan Dowsethat are critical to the boot process.
782bc53e11SIan DowseFor non-critical filesystems, the
792bc53e11SIan Dowse.Fl b
802bc53e11SIan Dowseand
812bc53e11SIan Dowse.Fl R
822bc53e11SIan Dowseflags provide mechanisms to prevent the boot process from hanging
832bc53e11SIan Dowseif the server is unavailable.
842bc53e11SIan Dowse.Pp
852bc53e11SIan DowseIf the server becomes unresponsive while an NFS filesystem is
862bc53e11SIan Dowsemounted, any new or outstanding file operations on that filesystem
872bc53e11SIan Dowsewill hang uninterruptibly until the server comes back.
882bc53e11SIan DowseTo modify this default behaviour, see the
892bc53e11SIan Dowse.Fl i
902bc53e11SIan Dowseand
912bc53e11SIan Dowse.Fl s
922bc53e11SIan Dowseflags.
932bc53e11SIan Dowse.Pp
948fae3551SRodney W. GrimesThe options are:
958fae3551SRodney W. Grimes.Bl -tag -width indent
962cd1c32cSDoug Rabson.It Fl 2
972cd1c32cSDoug RabsonUse the NFS Version 2 protocol (the default is to try version 3 first
98e2b2b076SPeter Wemmthen version 2).  Note that NFS version 2 has a file size limit of 2
99e2b2b076SPeter Wemmgigabytes.
100a62dc406SDoug Rabson.It Fl 3
1012cd1c32cSDoug RabsonUse the NFS Version 3 protocol.
1028fae3551SRodney W. Grimes.It Fl D
10391196234SPeter WemmSet the
1048fae3551SRodney W. Grimes.Dq "dead server threshold"
10591196234SPeter Wemmto the specified number of round trip timeout intervals before a
10691196234SPeter Wemm.Dq "server not responding"
10791196234SPeter Wemmmessage is displayed.
108a62dc406SDoug Rabson.It Fl I
109ef8f7ac9SSheldon HearnSet the readdir read size to the specified value.
110ef8f7ac9SSheldon HearnThe value should normally
111a62dc406SDoug Rabsonbe a multiple of DIRBLKSIZ that is <= the read size for the mount.
11213190d87SAlfred Perlstein.It Fl L
11313190d87SAlfred PerlsteinDo
11413190d87SAlfred Perlstein.Em not
11513190d87SAlfred Perlsteinforward
11613190d87SAlfred Perlstein.Xr fcntl 2
11713190d87SAlfred Perlsteinlocks over the wire.
11813190d87SAlfred PerlsteinAll locks will be local and not seen by the server
11913190d87SAlfred Perlsteinand likewise not seen by other NFS clients.  This removes
12013190d87SAlfred Perlsteinthe need to run the
12113190d87SAlfred Perlstein.Xr rpcbind 8
12213190d87SAlfred Perlsteinservice and the
12313190d87SAlfred Perlstein.Xr rpc.statd 8
12413190d87SAlfred Perlsteinand
12513190d87SAlfred Perlstein.Xr rpc.lockd 8
12613190d87SAlfred Perlsteinservers on the client.
127cc75b131SJoerg Wunsch.It Fl N
128cc75b131SJoerg WunschDo
129cc75b131SJoerg Wunsch.Em not
130cc75b131SJoerg Wunschuse a reserved socket port number (see below).
1318fae3551SRodney W. Grimes.It Fl P
1328fae3551SRodney W. GrimesUse a reserved socket port number.
133cc75b131SJoerg WunschThis flag is obsolete, and only retained for compatibility reasons.
134cc75b131SJoerg WunschReserved port numbers are used by default now.
1358fae3551SRodney W. GrimesThis is useful for mounting servers that require clients to use a
136a62dc406SDoug Rabsonreserved port number on the mistaken belief that this makes NFS
1374e86fcacSSheldon Hearnmore secure.
1384e86fcacSSheldon Hearn(For the rare case where the client has a trusted root account
139e71057d8SMike Pritchardbut untrustworthy users and the network cables are in secure areas this does
140a62dc406SDoug Rabsonhelp, but for normal desktop clients this does not apply.)
1418fae3551SRodney W. Grimes.It Fl R
142e16873daSIan DowseSet the mount retry count to the specified value.
1432bc53e11SIan DowseThe default is a retry count of zero, which means to keep retrying
1442bc53e11SIan Dowseforever.
145e16873daSIan DowseThere is a 60 second delay between each attempt.
1468fae3551SRodney W. Grimes.It Fl T
1478fae3551SRodney W. GrimesUse TCP transport instead of UDP.
1488fae3551SRodney W. GrimesThis is recommended for servers that are not on the same LAN cable as
1498fae3551SRodney W. Grimesthe client.
150753d686dSRuslan Ermilov(NB: This is NOT supported by most
151753d686dSRuslan Ermilov.No non- Ns Bx
152753d686dSRuslan Ermilovservers.)
153a62dc406SDoug Rabson.It Fl U
154a62dc406SDoug RabsonForce the mount protocol to use UDP transport, even for TCP NFS mounts.
155753d686dSRuslan Ermilov(Necessary for some old
156753d686dSRuslan Ermilov.Bx
157753d686dSRuslan Ermilovservers.)
1588fae3551SRodney W. Grimes.It Fl a
1598fae3551SRodney W. GrimesSet the read-ahead count to the specified value.
1608fae3551SRodney W. GrimesThis may be in the range of 0 - 4, and determines how many blocks
1618fae3551SRodney W. Grimeswill be read ahead when a large file is being read sequentially.
162a62dc406SDoug RabsonTrying a value greater than 1 for this is suggested for
163a62dc406SDoug Rabsonmounts with a large bandwidth * delay product.
1648fae3551SRodney W. Grimes.It Fl b
1658fae3551SRodney W. GrimesIf an initial attempt to contact the server fails, fork off a child to keep
1668fae3551SRodney W. Grimestrying the mount in the background.
1678fae3551SRodney W. GrimesUseful for
1688fae3551SRodney W. Grimes.Xr fstab 5 ,
1698fae3551SRodney W. Grimeswhere the filesystem mount is not critical to multiuser operation.
1708fae3551SRodney W. Grimes.It Fl c
1718fae3551SRodney W. GrimesFor UDP mount points, do not do a
1728fae3551SRodney W. Grimes.Xr connect 2 .
1738fae3551SRodney W. GrimesThis must be used for servers that do not reply to requests from the
174a62dc406SDoug Rabsonstandard NFS port number 2049.
1758fae3551SRodney W. Grimes.It Fl d
176a62dc406SDoug RabsonTurn off the dynamic retransmit timeout estimator.
177a62dc406SDoug RabsonThis may be useful for UDP mounts that exhibit high retry rates,
178a62dc406SDoug Rabsonsince it is possible that the dynamically estimated timeout interval is too
179a62dc406SDoug Rabsonshort.
1808fae3551SRodney W. Grimes.It Fl g
1818fae3551SRodney W. GrimesSet the maximum size of the group list for the credentials to the
1828fae3551SRodney W. Grimesspecified value.
1838fae3551SRodney W. GrimesThis should be used for mounts on old servers that cannot handle a
1848fae3551SRodney W. Grimesgroup list size of 16, as specified in RFC 1057.
1858fae3551SRodney W. GrimesTry 8, if users in a lot of groups cannot get response from the mount
1868fae3551SRodney W. Grimespoint.
1878fae3551SRodney W. Grimes.It Fl i
1888fae3551SRodney W. GrimesMake the mount interruptible, which implies that file system calls that
1898fae3551SRodney W. Grimesare delayed due to an unresponsive server will fail with EINTR when a
1908fae3551SRodney W. Grimestermination signal is posted for the process.
1918fae3551SRodney W. Grimes.It Fl l
192a62dc406SDoug RabsonUsed with NQNFS and NFSV3 to specify that the \fBReaddirPlus\fR RPC should
1938fae3551SRodney W. Grimesbe used.
1948fae3551SRodney W. GrimesThis option reduces RPC traffic for cases such as
1958fae3551SRodney W. Grimes.Dq "ls -l" ,
196a62dc406SDoug Rabsonbut tends to flood the attribute and name caches with prefetched entries.
197ef8f7ac9SSheldon HearnTry this option and see whether performance improves or degrades.
198ef8f7ac9SSheldon HearnProbably
199a62dc406SDoug Rabsonmost useful for client to server network interconnects with a large bandwidth
200a62dc406SDoug Rabsontimes delay product.
2018fae3551SRodney W. Grimes.It Fl o
2028fae3551SRodney W. GrimesOptions are specified with a
2038fae3551SRodney W. Grimes.Fl o
2048fae3551SRodney W. Grimesflag followed by a comma separated string of options.
2058fae3551SRodney W. GrimesSee the
2068fae3551SRodney W. Grimes.Xr mount 8
2078fae3551SRodney W. Grimesman page for possible options and their meanings.
208bc2cfd71SKarl StricklandThe following NFS specific option is also available:
209bc2cfd71SKarl Strickland.Bl -tag -width indent
210bc2cfd71SKarl Strickland.It port=<port_number>
211bc2cfd71SKarl StricklandUse specified port number for NFS requests.
212bc2cfd71SKarl StricklandThe default is to query the portmapper for the NFS port.
213c92e3fa5SPeter Wemm.It acregmin=<seconds>
214c92e3fa5SPeter Wemm.It acregmax=<seconds>
215c92e3fa5SPeter Wemm.It acdirmin=<seconds>
216c92e3fa5SPeter Wemm.It acdirmax=<seconds>
21746fc8f78SPhilippe CharnierWhen attributes of files are cached, a timeout calculated to determine
218c92e3fa5SPeter Wemmwhether a given cache entry has expired.  These four values determine the
219c92e3fa5SPeter Wemmupper and lower bounds of the timeouts for ``directory'' attributes and
220c92e3fa5SPeter Wemm``regular'' (ie: everything else).  The default values are 3 -> 60 seconds
221c92e3fa5SPeter Wemmfor regular files, and 30 -> 60 seconds for directories.  The algorithm to
222c92e3fa5SPeter Wemmcalculate the timeout is based on the age of the file.  The older the file,
223c92e3fa5SPeter Wemmthe longer the cache is considered valid, subject to the limits above.
224bc2cfd71SKarl Strickland.El
225f9dc1926SJoerg Wunsch.Pp
226f9dc1926SJoerg Wunsch.Bl -tag -width "dumbtimerXX"
227f9dc1926SJoerg Wunsch\fBHistoric \&-o options\fR
228f9dc1926SJoerg Wunsch.Pp
229f9dc1926SJoerg WunschUse of these options is deprecated, they are only mentioned here for
230f9dc1926SJoerg Wunschcompatibility with historic versions of
2317c7fb079SRuslan Ermilov.Nm .
232f9dc1926SJoerg Wunsch.It bg
233f9dc1926SJoerg WunschSame as
234f9dc1926SJoerg Wunsch.Fl b .
235f9dc1926SJoerg Wunsch.It conn
236a34f78d1SJoseph KoshySame as not specifying
237f9dc1926SJoerg Wunsch.Fl c .
238f9dc1926SJoerg Wunsch.It dumbtimer
239f9dc1926SJoerg WunschSame as
240f9dc1926SJoerg Wunsch.Fl d .
241f9dc1926SJoerg Wunsch.It intr
242f9dc1926SJoerg WunschSame as
243f9dc1926SJoerg Wunsch.Fl i .
24413190d87SAlfred Perlstein.It lockd
24513190d87SAlfred PerlsteinSame as not specifying
24613190d87SAlfred Perlstein.Fl L .
2472cd1c32cSDoug Rabson.It nfsv2
2482cd1c32cSDoug RabsonSame as
2492cd1c32cSDoug Rabson.Fl 2 .
250f9dc1926SJoerg Wunsch.It nfsv3
251f9dc1926SJoerg WunschSame as
252f9dc1926SJoerg Wunsch.Fl 3 .
253f9dc1926SJoerg Wunsch.It rdirplus
254f9dc1926SJoerg WunschSame as
255f9dc1926SJoerg Wunsch.Fl l .
256f9dc1926SJoerg Wunsch.It mntudp
257f9dc1926SJoerg WunschSame as
258f9dc1926SJoerg Wunsch.Fl U .
259f9dc1926SJoerg Wunsch.It resvport
260f9dc1926SJoerg WunschSame as
261f9dc1926SJoerg Wunsch.Fl P .
262f9dc1926SJoerg Wunsch.It seqpacket
263f9dc1926SJoerg WunschSame as
264f9dc1926SJoerg Wunsch.Fl p .
265f9dc1926SJoerg Wunsch.It soft
266f9dc1926SJoerg WunschSame as
267f9dc1926SJoerg Wunsch.Fl s .
268f9dc1926SJoerg Wunsch.It tcp
269f9dc1926SJoerg WunschSame as
270f9dc1926SJoerg Wunsch.Fl T .
271f9dc1926SJoerg Wunsch.El
2728fae3551SRodney W. Grimes.It Fl r
2738fae3551SRodney W. GrimesSet the read data size to the specified value.
274a62dc406SDoug RabsonIt should normally be a power of 2 greater than or equal to 1024.
2758fae3551SRodney W. GrimesThis should be used for UDP mounts when the
2768fae3551SRodney W. Grimes.Dq "fragments dropped due to timeout"
2778fae3551SRodney W. Grimesvalue is getting large while actively using a mount point.
2788fae3551SRodney W. Grimes(Use
2798fae3551SRodney W. Grimes.Xr netstat 1
2808fae3551SRodney W. Grimeswith the
2818fae3551SRodney W. Grimes.Fl s
2828fae3551SRodney W. Grimesoption to see what the
2838fae3551SRodney W. Grimes.Dq "fragments dropped due to timeout"
2848fae3551SRodney W. Grimesvalue is.)
2858fae3551SRodney W. GrimesSee the
2868fae3551SRodney W. Grimes.Fl w
2878fae3551SRodney W. Grimesoption as well.
2888fae3551SRodney W. Grimes.It Fl s
2898fae3551SRodney W. GrimesA soft mount, which implies that file system calls will fail
2908fae3551SRodney W. Grimesafter \fBRetry\fR round trip timeout intervals.
2918fae3551SRodney W. Grimes.It Fl t
2928fae3551SRodney W. GrimesSet the initial retransmit timeout to the specified value.
2938fae3551SRodney W. GrimesMay be useful for fine tuning UDP mounts over internetworks
2948fae3551SRodney W. Grimeswith high packet loss rates or an overloaded server.
2958fae3551SRodney W. GrimesTry increasing the interval if
2968fae3551SRodney W. Grimes.Xr nfsstat 1
2978fae3551SRodney W. Grimesshows high retransmit rates while the file system is active or reducing the
2988fae3551SRodney W. Grimesvalue if there is a low retransmit rate but long response delay observed.
299a62dc406SDoug Rabson(Normally, the -d option should be specified when using this option to manually
300a62dc406SDoug Rabsontune the timeout
301a62dc406SDoug Rabsoninterval.)
3028fae3551SRodney W. Grimes.It Fl w
3038fae3551SRodney W. GrimesSet the write data size to the specified value.
3048fae3551SRodney W. GrimesDitto the comments w.r.t. the
3058fae3551SRodney W. Grimes.Fl r
3068fae3551SRodney W. Grimesoption, but using the
3078fae3551SRodney W. Grimes.Dq "fragments dropped due to timeout"
3088fae3551SRodney W. Grimesvalue on the server instead of the client.
3098fae3551SRodney W. GrimesNote that both the
3108fae3551SRodney W. Grimes.Fl r
3118fae3551SRodney W. Grimesand
3128fae3551SRodney W. Grimes.Fl w
3138fae3551SRodney W. Grimesoptions should only be used as a last ditch effort at improving performance
3148fae3551SRodney W. Grimeswhen mounting servers that do not support TCP mounts.
3158fae3551SRodney W. Grimes.It Fl x
3168fae3551SRodney W. GrimesSet the retransmit timeout count for soft mounts to the specified value.
3178fae3551SRodney W. Grimes.El
3188fae3551SRodney W. Grimes.Sh SEE ALSO
3198fae3551SRodney W. Grimes.Xr mount 2 ,
3208fae3551SRodney W. Grimes.Xr unmount 2 ,
3218fae3551SRodney W. Grimes.Xr fstab 5 ,
3222a2d4405SMatthew Dillon.Xr mount 8 ,
323ffc717e2SSheldon Hearn.Xr nfsd 8 ,
324893d2b85SSheldon Hearn.Xr nfsiod 8 ,
325893d2b85SSheldon Hearn.Xr showmount 8
3268fae3551SRodney W. Grimes.Sh BUGS
3278fae3551SRodney W. GrimesDue to the way that Sun RPC is implemented on top of UDP (unreliable datagram)
3288fae3551SRodney W. Grimestransport, tuning such mounts is really a black art that can only be expected
3298fae3551SRodney W. Grimesto have limited success.
3308fae3551SRodney W. GrimesFor clients mounting servers that are not on the same
3318fae3551SRodney W. GrimesLAN cable or that tend to be overloaded,
3328fae3551SRodney W. GrimesTCP transport is strongly recommended,
333753d686dSRuslan Ermilovbut unfortunately this is restricted to mostly
334753d686dSRuslan Ermilov.Bx 4.4
335753d686dSRuslan Ermilovservers.
336