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