xref: /freebsd/usr.sbin/mountd/mountd.8 (revision 3a0793336edfc21cb6d4c8c5c5d7f1665f3e6c5a)
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.Dd April 8, 2024
29.Dt MOUNTD 8
30.Os
31.Sh NAME
32.Nm mountd
33.Nd service remote
34.Tn NFS
35mount requests
36.Sh SYNOPSIS
37.Nm
38.Op Fl 2AdelnRrS
39.Op Fl h Ar bindip
40.Op Fl p Ar port
41.Op Ar exportsfile ...
42.Sh DESCRIPTION
43The
44.Nm
45utility is the server for
46.Tn NFS
47mount requests from other client machines.
48It listens for service requests at the port indicated in the
49.Tn NFS
50server specification; see
51.%T "Network File System Protocol Specification" ,
52RFC1094, Appendix A and
53.%T "NFS: Network File System Version 3 Protocol Specification" ,
54RFC1813, Appendix I.
55.Pp
56The following options are available:
57.Bl -tag -width indent
58.It Fl 2
59Allow the administrator to force clients to use only the
60version 2
61.Tn NFS
62protocol to mount file systems from this server.
63.It Fl A
64Silence the warnings related to
65.Dq administrative controls .
66These warnings remind users that an exported
67.Dq administrative control
68directory that is not a local server file system mount point
69actually exports the entire local file system and not just
70the subtree below the directory exported.
71(See
72.Xr exports 5 )
73.It Fl d
74Output debugging information.
75.Nm
76will not detach from the controlling terminal and will print
77debugging messages to stderr.
78.It Fl e
79Ignored; included for backward compatibility.
80.It Fl h Ar bindip
81Specify specific IP addresses to bind to for TCP and UDP requests.
82This option may be specified multiple times.
83If no
84.Fl h
85option is specified,
86.Nm
87will bind to
88.Dv INADDR_ANY .
89Note that when specifying IP addresses with
90.Fl h ,
91.Nm
92will automatically add
93.Li 127.0.0.1
94and if IPv6 is enabled,
95.Li ::1
96to the list.
97.It Fl l
98Cause all succeeded
99.Nm
100requests to be logged.
101.It Fl n
102Allow non-root mount requests to be served.
103This should only be specified if there are clients such as PC's,
104that require it.
105It will automatically clear the vfs.nfsd.nfs_privport sysctl flag, which
106controls if the kernel will accept NFS requests from reserved ports only.
107.It Fl p Ar port
108Force
109.Nm
110to bind to the specified port, for both
111.Dv AF_INET
112and
113.Dv AF_INET6
114address families.
115This is typically done to ensure that the port which
116.Nm
117binds to is a known quantity which can be used in firewall rulesets.
118If
119.Nm
120cannot bind to this port, an appropriate error will be recorded in
121the system log, and the daemon will then exit.
122.It Fl R
123Do not support the Mount protocol and do not register with
124.Xr rpcbind 8 .
125This can be done for NFSv4 only servers, since the Mount protocol is not
126used by NFSv4.
127Useful for NFSv4 only servers that do not wish to run
128.Xr rpcbind 8 .
129.Xr showmount 8
130will not work, however since NFSv4 mounts are not shown by
131.Xr showmount 8 ,
132this should not be an issue for an NFSv4 only server.
133.It Fl r
134Allow mount RPCs requests for regular files to be served.
135Although this seems to violate the mount protocol specification,
136some diskless workstations do mount requests for
137their swapfiles and expect them to be regular files.
138Since a regular file cannot be specified in
139.Pa /etc/exports ,
140the entire file system in which the swapfiles resides
141will have to be exported with the
142.Fl alldirs
143flag.
144.It Ar exportsfile
145Specify an alternate location
146for the exports file.
147More than one exports file can be specified.
148.It Fl S
149Tell mountd to suspend/resume execution of the nfsd threads whenever
150the exports list is being reloaded.
151This avoids intermittent access
152errors for clients that do NFS RPCs while the exports are being
153reloaded, but introduces a delay in RPC response while the reload
154is in progress.
155If
156.Nm
157crashes while an exports load is in progress,
158.Nm
159must be restarted to get the nfsd threads running again, if this
160option is used.
161.El
162.Pp
163When
164.Nm
165is started,
166it loads the export host addresses and options into the kernel
167using the
168.Xr nmount 2
169system call.
170After changing the exports file,
171a hangup signal should be sent to the
172.Nm
173daemon
174to get it to reload the export information.
175After sending the SIGHUP
176(kill \-s HUP `cat /var/run/mountd.pid`),
177check the syslog output to see if
178.Nm
179logged any parsing
180errors in the exports file.
181.Pp
182If multiple instances of
183.Nm
184are being run, either in multiple jails or both within
185and outside of a jail, care must be taken to export
186any given file system in only one of the instances.
187Note that the
188.Va allow.nfsd
189jail parameter is required to allow
190.Nm
191to run in a jail.
192See
193.Xr jail 8
194for more information.
195.Pp
196If
197.Nm
198detects that the running kernel does not include
199.Tn NFS
200support, it will attempt to load a loadable kernel module containing
201.Tn NFS
202code, using
203.Xr kldload 2 .
204If this fails, or no
205.Tn NFS
206KLD was available,
207.Nm
208exits with an error.
209When run in a jail, the
210.Xr kldload 2
211must be done outside the jail, typically by adding
212.Dq nfsd
213to
214.Va kld_list
215in the
216.Xr rc.conf 5
217file on the jail host.
218.Sh FILES
219.Bl -tag -width /var/run/mountd.pid -compact
220.It Pa /etc/exports
221the list of exported file systems
222.It Pa /var/run/mountd.pid
223the pid of the currently running mountd
224.It Pa /var/db/mountdtab
225the current list of remote mounted file systems
226.El
227.Sh SEE ALSO
228.Xr nfsstat 1 ,
229.Xr kldload 2 ,
230.Xr nfsv4 4 ,
231.Xr exports 5 ,
232.Xr rc.conf 5 ,
233.Xr jail 8 ,
234.Xr nfsd 8 ,
235.Xr rpcbind 8 ,
236.Xr showmount 8
237.Sh HISTORY
238The
239.Nm
240utility first appeared in
241.Bx 4.4 .
242