xref: /freebsd/sbin/mount_nfs/mount_nfs.8 (revision 5521ff5a4d1929056e7ffc982fac3341ca54df7c)
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$
35.\""
36.Dd March 29, 1995
37.Dt MOUNT_NFS 8
38.Os BSD 4.4
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
74The options are:
75.Bl -tag -width indent
76.It Fl 2
77Use the NFS Version 2 protocol (the default is to try version 3 first
78then version 2).  Note that NFS version 2 has a file size limit of 2
79gigabytes.
80.It Fl 3
81Use the NFS Version 3 protocol.
82.It Fl D
83Used with NQNFS to set the
84.Dq "dead server threshold"
85to the specified number of round trip timeout intervals.
86After a
87.Dq "dead server threshold"
88of retransmit timeouts,
89cached data for the unresponsive server is assumed to still be valid.
90Values may be set in the range of 1 - 9, with 9 referring to an
91.Dq "infinite dead threshold"
92(i.e. never assume cached data still valid).
93This option is not generally recommended and is really an experimental
94feature.
95.It Fl I
96Set the readdir read size to the specified value.
97The value should normally
98be a multiple of DIRBLKSIZ that is <= the read size for the mount.
99.It Fl K
100Pass Kerberos authenticators to the server for client-to-server
101user-credential mapping.
102This requires that the kernel be built with the NFSKERB option.
103The use of this option will prevent the kernel from compiling
104unless calls to the appropriate Kerberos encryption routines
105are provided in the NFS source.
106(Refer to the INTERNET-DRAFT titled
107.%T "Authentication Mechanisms for ONC RPC" ,
108for more information.)
109.It Fl L
110Used with NQNFS to set the lease term to the specified number of seconds.
111Only use this argument for mounts with a large round trip delay.
112Values are normally in the 10-30 second range.
113.It Fl N
114Do
115.Em not
116use a reserved socket port number (see below).
117.It Fl P
118Use a reserved socket port number.
119This flag is obsolete, and only retained for compatibility reasons.
120Reserved port numbers are used by default now.
121This is useful for mounting servers that require clients to use a
122reserved port number on the mistaken belief that this makes NFS
123more secure.
124(For the rare case where the client has a trusted root account
125but untrustworthy users and the network cables are in secure areas this does
126help, but for normal desktop clients this does not apply.)
127.It Fl R
128Set the retry count for doing the mount to the specified value.
129.It Fl T
130Use TCP transport instead of UDP.
131This is recommended for servers that are not on the same LAN cable as
132the client.
133(NB: This is NOT supported by most non-BSD servers.)
134.It Fl U
135Force the mount protocol to use UDP transport, even for TCP NFS mounts.
136(Necessary for some old BSD servers.)
137.It Fl a
138Set the read-ahead count to the specified value.
139This may be in the range of 0 - 4, and determines how many blocks
140will be read ahead when a large file is being read sequentially.
141Trying a value greater than 1 for this is suggested for
142mounts with a large bandwidth * delay product.
143.It Fl b
144If an initial attempt to contact the server fails, fork off a child to keep
145trying the mount in the background.
146Useful for
147.Xr fstab 5 ,
148where the filesystem mount is not critical to multiuser operation.
149.It Fl c
150For UDP mount points, do not do a
151.Xr connect 2 .
152This must be used for servers that do not reply to requests from the
153standard NFS port number 2049.
154.It Fl d
155Turn off the dynamic retransmit timeout estimator.
156This may be useful for UDP mounts that exhibit high retry rates,
157since it is possible that the dynamically estimated timeout interval is too
158short.
159.It Fl g
160Set the maximum size of the group list for the credentials to the
161specified value.
162This should be used for mounts on old servers that cannot handle a
163group list size of 16, as specified in RFC 1057.
164Try 8, if users in a lot of groups cannot get response from the mount
165point.
166.It Fl i
167Make the mount interruptible, which implies that file system calls that
168are delayed due to an unresponsive server will fail with EINTR when a
169termination signal is posted for the process.
170.It Fl l
171Used with NQNFS and NFSV3 to specify that the \fBReaddirPlus\fR RPC should
172be used.
173This option reduces RPC traffic for cases such as
174.Dq "ls -l" ,
175but tends to flood the attribute and name caches with prefetched entries.
176Try this option and see whether performance improves or degrades.
177Probably
178most useful for client to server network interconnects with a large bandwidth
179times delay product.
180.It Fl m
181Set the Kerberos realm to the string argument.
182Used with the
183.Fl K
184option for mounts to other realms.
185.It Fl o
186Options are specified with a
187.Fl o
188flag followed by a comma separated string of options.
189See the
190.Xr mount 8
191man page for possible options and their meanings.
192The following NFS specific option is also available:
193.Bl -tag -width indent
194.It port=<port_number>
195Use specified port number for NFS requests.
196The default is to query the portmapper for the NFS port.
197.It acregmin=<seconds>
198.It acregmax=<seconds>
199.It acdirmin=<seconds>
200.It acdirmax=<seconds>
201When attributes of files are cached, a timeout calculated to determine
202whether a given cache entry has expired.  These four values determine the
203upper and lower bounds of the timeouts for ``directory'' attributes and
204``regular'' (ie: everything else).  The default values are 3 -> 60 seconds
205for regular files, and 30 -> 60 seconds for directories.  The algorithm to
206calculate the timeout is based on the age of the file.  The older the file,
207the longer the cache is considered valid, subject to the limits above.
208.El
209.Pp
210.Bl -tag -width "dumbtimerXX"
211\fBHistoric \&-o options\fR
212.Pp
213Use of these options is deprecated, they are only mentioned here for
214compatibility with historic versions of
215.Nm .
216.It bg
217Same as
218.Fl b .
219.It conn
220Same as not specifying
221.Fl c .
222.It dumbtimer
223Same as
224.Fl d .
225.It intr
226Same as
227.Fl i .
228.It kerb
229Same as
230.Fl K .
231.It nfsv2
232Same as
233.Fl 2 .
234.It nfsv3
235Same as
236.Fl 3 .
237.It rdirplus
238Same as
239.Fl l .
240.It mntudp
241Same as
242.Fl U .
243.It resvport
244Same as
245.Fl P .
246.It seqpacket
247Same as
248.Fl p .
249.It nqnfs
250Same as
251.Fl q .
252.It soft
253Same as
254.Fl s .
255.It tcp
256Same as
257.Fl T .
258.El
259.It Fl q
260Use the Not Quite NFS (NQNFS) protocol.
261This experimental protocol is NFS Version 2 with leasing extensions
262similar to those found in NFS Version 3.
263The interoperability of this protocol with other systems is
264very limited and its implementation is not widely used.
265Do not use this option unless you know exactly what you are doing!
266.It Fl r
267Set the read data size to the specified value.
268It should normally be a power of 2 greater than or equal to 1024.
269This should be used for UDP mounts when the
270.Dq "fragments dropped due to timeout"
271value is getting large while actively using a mount point.
272(Use
273.Xr netstat 1
274with the
275.Fl s
276option to see what the
277.Dq "fragments dropped due to timeout"
278value is.)
279See the
280.Fl w
281option as well.
282.It Fl s
283A soft mount, which implies that file system calls will fail
284after \fBRetry\fR round trip timeout intervals.
285.It Fl t
286Set the initial retransmit timeout to the specified value.
287May be useful for fine tuning UDP mounts over internetworks
288with high packet loss rates or an overloaded server.
289Try increasing the interval if
290.Xr nfsstat 1
291shows high retransmit rates while the file system is active or reducing the
292value if there is a low retransmit rate but long response delay observed.
293(Normally, the -d option should be specified when using this option to manually
294tune the timeout
295interval.)
296.It Fl w
297Set the write data size to the specified value.
298Ditto the comments w.r.t. the
299.Fl r
300option, but using the
301.Dq "fragments dropped due to timeout"
302value on the server instead of the client.
303Note that both the
304.Fl r
305and
306.Fl w
307options should only be used as a last ditch effort at improving performance
308when mounting servers that do not support TCP mounts.
309.It Fl x
310Set the retransmit timeout count for soft mounts to the specified value.
311.El
312.Sh SEE ALSO
313.Xr mount 2 ,
314.Xr unmount 2 ,
315.Xr fstab 5 ,
316.Xr mount 8 ,
317.Xr nfsd 8 ,
318.Xr nfsiod 8 ,
319.Xr showmount 8
320.Sh BUGS
321Due to the way that Sun RPC is implemented on top of UDP (unreliable datagram)
322transport, tuning such mounts is really a black art that can only be expected
323to have limited success.
324For clients mounting servers that are not on the same
325LAN cable or that tend to be overloaded,
326TCP transport is strongly recommended,
327but unfortunately this is restricted to mostly 4.4BSD servers.
328