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