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