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