]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/mountd/mountd.8
bsddialog: import version 1.0
[FreeBSD/FreeBSD.git] / usr.sbin / mountd / mountd.8
1 .\" Copyright (c) 1989, 1991, 1993
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. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)mountd.8    8.4 (Berkeley) 4/28/95
29 .\"
30 .Dd March 18, 2023
31 .Dt MOUNTD 8
32 .Os
33 .Sh NAME
34 .Nm mountd
35 .Nd service remote
36 .Tn NFS
37 mount requests
38 .Sh SYNOPSIS
39 .Nm
40 .Op Fl 2delnRrS
41 .Op Fl h Ar bindip
42 .Op Fl p Ar port
43 .Op Ar exportsfile ...
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility is the server for
48 .Tn NFS
49 mount requests from other client machines.
50 It listens for service requests at the port indicated in the
51 .Tn NFS
52 server specification; see
53 .%T "Network File System Protocol Specification" ,
54 RFC1094, Appendix A and
55 .%T "NFS: Network File System Version 3 Protocol Specification" ,
56 RFC1813, Appendix I.
57 .Pp
58 The following options are available:
59 .Bl -tag -width indent
60 .It Fl 2
61 Allow the administrator to force clients to use only the
62 version 2
63 .Tn NFS
64 protocol to mount file systems from this server.
65 .It Fl d
66 Output debugging information.
67 .Nm
68 will not detach from the controlling terminal and will print
69 debugging messages to stderr.
70 .It Fl e
71 Ignored; included for backward compatibility.
72 .It Fl h Ar bindip
73 Specify specific IP addresses to bind to for TCP and UDP requests.
74 This option may be specified multiple times.
75 If no
76 .Fl h
77 option is specified,
78 .Nm
79 will bind to
80 .Dv INADDR_ANY .
81 Note that when specifying IP addresses with
82 .Fl h ,
83 .Nm
84 will automatically add
85 .Li 127.0.0.1
86 and if IPv6 is enabled,
87 .Li ::1
88 to the list.
89 .It Fl l
90 Cause all succeeded
91 .Nm
92 requests to be logged.
93 .It Fl n
94 Allow non-root mount requests to be served.
95 This should only be specified if there are clients such as PC's,
96 that require it.
97 It will automatically clear the vfs.nfsd.nfs_privport sysctl flag, which
98 controls if the kernel will accept NFS requests from reserved ports only.
99 .It Fl p Ar port
100 Force
101 .Nm
102 to bind to the specified port, for both
103 .Dv AF_INET
104 and
105 .Dv AF_INET6
106 address families.
107 This is typically done to ensure that the port which
108 .Nm
109 binds to is a known quantity which can be used in firewall rulesets.
110 If
111 .Nm
112 cannot bind to this port, an appropriate error will be recorded in
113 the system log, and the daemon will then exit.
114 .It Fl R
115 Do not support the Mount protocol and do not register with
116 .Xr rpcbind 8 .
117 This can be done for NFSv4 only servers, since the Mount protocol is not
118 used by NFSv4.
119 Useful for NFSv4 only servers that do not wish to run
120 .Xr rpcbind 8 .
121 .Xr showmount 8
122 will not work, however since NFSv4 mounts are not shown by
123 .Xr showmount 8 ,
124 this should not be an issue for an NFSv4 only server.
125 .It Fl r
126 Allow mount RPCs requests for regular files to be served.
127 Although this seems to violate the mount protocol specification,
128 some diskless workstations do mount requests for
129 their swapfiles and expect them to be regular files.
130 Since a regular file cannot be specified in
131 .Pa /etc/exports ,
132 the entire file system in which the swapfiles resides
133 will have to be exported with the
134 .Fl alldirs
135 flag.
136 .It Ar exportsfile
137 Specify an alternate location
138 for the exports file.
139 More than one exports file can be specified.
140 .It Fl S
141 Tell mountd to suspend/resume execution of the nfsd threads whenever
142 the exports list is being reloaded.
143 This avoids intermittent access
144 errors for clients that do NFS RPCs while the exports are being
145 reloaded, but introduces a delay in RPC response while the reload
146 is in progress.
147 If
148 .Nm
149 crashes while an exports load is in progress,
150 .Nm
151 must be restarted to get the nfsd threads running again, if this
152 option is used.
153 .El
154 .Pp
155 When
156 .Nm
157 is started,
158 it loads the export host addresses and options into the kernel
159 using the
160 .Xr nmount 2
161 system call.
162 After changing the exports file,
163 a hangup signal should be sent to the
164 .Nm
165 daemon
166 to get it to reload the export information.
167 After sending the SIGHUP
168 (kill \-s HUP `cat /var/run/mountd.pid`),
169 check the syslog output to see if
170 .Nm
171 logged any parsing
172 errors in the exports file.
173 .Pp
174 If multiple instances of
175 .Nm
176 are being run, either in multiple jails or both within
177 and outside of a jail, care must be taken to export
178 any given file system in only one of the instances.
179 Note that the
180 .Va allow.nfsd
181 jail parameter is required to allow
182 .Nm
183 to run in a jail.
184 See
185 .Xr jail 8
186 for more information.
187 .Pp
188 If
189 .Nm
190 detects that the running kernel does not include
191 .Tn NFS
192 support, it will attempt to load a loadable kernel module containing
193 .Tn NFS
194 code, using
195 .Xr kldload 2 .
196 If this fails, or no
197 .Tn NFS
198 KLD was available,
199 .Nm
200 exits with an error.
201 When run in a jail, the
202 .Xr kldload 2
203 must be done outside the jail, typically by adding
204 .Dq nfsd
205 to
206 .Va kld_list
207 in the
208 .Xr rc.conf 5
209 file on the jail host.
210 .Sh FILES
211 .Bl -tag -width /var/run/mountd.pid -compact
212 .It Pa /etc/exports
213 the list of exported file systems
214 .It Pa /var/run/mountd.pid
215 the pid of the currently running mountd
216 .It Pa /var/db/mountdtab
217 the current list of remote mounted file systems
218 .El
219 .Sh SEE ALSO
220 .Xr nfsstat 1 ,
221 .Xr kldload 2 ,
222 .Xr nfsv4 4 ,
223 .Xr exports 5 ,
224 .Xr rc.conf 5 ,
225 .Xr jail 8 ,
226 .Xr nfsd 8 ,
227 .Xr rpcbind 8 ,
228 .Xr showmount 8
229 .Sh HISTORY
230 The
231 .Nm
232 utility first appeared in
233 .Bx 4.4 .