18fae3551SRodney W. Grimes.\" Copyright (c) 1989, 1991, 1993 28fae3551SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 38fae3551SRodney W. Grimes.\" 48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions 68fae3551SRodney W. Grimes.\" are met: 78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 88fae3551SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 108fae3551SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 118fae3551SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors 138fae3551SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 148fae3551SRodney W. Grimes.\" without specific prior written permission. 158fae3551SRodney W. Grimes.\" 168fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 178fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 188fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 198fae3551SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 208fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 218fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 228fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 238fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 248fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 258fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 268fae3551SRodney W. Grimes.\" SUCH DAMAGE. 278fae3551SRodney W. Grimes.\" 28*2e5c9eafSJoyu Liao.Dd July 5, 2024 298fae3551SRodney W. Grimes.Dt MOUNTD 8 308fae3551SRodney W. Grimes.Os 318fae3551SRodney W. Grimes.Sh NAME 328fae3551SRodney W. Grimes.Nm mountd 338fae3551SRodney W. Grimes.Nd service remote 348fae3551SRodney W. Grimes.Tn NFS 358fae3551SRodney W. Grimesmount requests 368fae3551SRodney W. Grimes.Sh SYNOPSIS 377c7fb079SRuslan Ermilov.Nm 38*2e5c9eafSJoyu Liao.Op Fl 2AdelNnRrSs 39d11e3645SMatteo Riondato.Op Fl h Ar bindip 40c203da27SBruce M Simpson.Op Fl p Ar port 4196968c22SPawel Jakub Dawidek.Op Ar exportsfile ... 428fae3551SRodney W. Grimes.Sh DESCRIPTION 43e1205e80SPhilippe CharnierThe 44e1205e80SPhilippe Charnier.Nm 45e1205e80SPhilippe Charnierutility is the server for 468fae3551SRodney W. Grimes.Tn NFS 478fae3551SRodney W. Grimesmount requests from other client machines. 4874853402SPhilippe CharnierIt listens for service requests at the port indicated in the 498fae3551SRodney W. Grimes.Tn NFS 508fae3551SRodney W. Grimesserver specification; see 518fae3551SRodney W. Grimes.%T "Network File System Protocol Specification" , 52a62dc406SDoug RabsonRFC1094, Appendix A and 53a62dc406SDoug Rabson.%T "NFS: Network File System Version 3 Protocol Specification" , 54b7e7ec5fSMark JohnstonRFC1813, Appendix I. 558fae3551SRodney W. Grimes.Pp 5674853402SPhilippe CharnierThe following options are available: 5774853402SPhilippe Charnier.Bl -tag -width indent 582a66cfc5SDoug Rabson.It Fl 2 5974853402SPhilippe CharnierAllow the administrator to force clients to use only the 6074853402SPhilippe Charnierversion 2 6174853402SPhilippe Charnier.Tn NFS 6274853402SPhilippe Charnierprotocol to mount file systems from this server. 63cce11997SRick Macklem.It Fl A 64cce11997SRick MacklemSilence the warnings related to 65cce11997SRick Macklem.Dq administrative controls . 66cce11997SRick MacklemThese warnings remind users that an exported 67cce11997SRick Macklem.Dq administrative control 68cce11997SRick Macklemdirectory that is not a local server file system mount point 69cce11997SRick Macklemactually exports the entire local file system and not just 70cce11997SRick Macklemthe subtree below the directory exported. 71cce11997SRick Macklem(See 72cce11997SRick Macklem.Xr exports 5 ) 732179ae1eSRick Macklem.It Fl d 742179ae1eSRick MacklemOutput debugging information. 752179ae1eSRick Macklem.Nm 762179ae1eSRick Macklemwill not detach from the controlling terminal and will print 772179ae1eSRick Macklemdebugging messages to stderr. 782179ae1eSRick Macklem.It Fl e 7979b86807SEdward Tomasz NapieralaIgnored; included for backward compatibility. 80d11e3645SMatteo Riondato.It Fl h Ar bindip 81d11e3645SMatteo RiondatoSpecify specific IP addresses to bind to for TCP and UDP requests. 82d11e3645SMatteo RiondatoThis option may be specified multiple times. 83d11e3645SMatteo RiondatoIf no 84d11e3645SMatteo Riondato.Fl h 85d11e3645SMatteo Riondatooption is specified, 86d11e3645SMatteo Riondato.Nm 87d11e3645SMatteo Riondatowill bind to 88d11e3645SMatteo Riondato.Dv INADDR_ANY . 89d11e3645SMatteo RiondatoNote that when specifying IP addresses with 90d11e3645SMatteo Riondato.Fl h , 91d11e3645SMatteo Riondato.Nm 92d11e3645SMatteo Riondatowill automatically add 93d11e3645SMatteo Riondato.Li 127.0.0.1 94d11e3645SMatteo Riondatoand if IPv6 is enabled, 95d11e3645SMatteo Riondato.Li ::1 96d11e3645SMatteo Riondatoto the list. 97690c488dSGuido van Rooij.It Fl l 9874853402SPhilippe CharnierCause all succeeded 9974853402SPhilippe Charnier.Nm 10074853402SPhilippe Charnierrequests to be logged. 101*2e5c9eafSJoyu Liao.It Fl N 102*2e5c9eafSJoyu LiaoCause 103*2e5c9eafSJoyu Liao.Nm 104*2e5c9eafSJoyu Liaoto execute in the foreground instead of in daemon mode. 1058fae3551SRodney W. Grimes.It Fl n 10674853402SPhilippe CharnierAllow non-root mount requests to be served. 1078fae3551SRodney W. GrimesThis should only be specified if there are clients such as PC's, 1088fae3551SRodney W. Grimesthat require it. 109a4a17097SRick MacklemIt will automatically clear the vfs.nfsd.nfs_privport sysctl flag, which 110099d4ed1SStephen McKaycontrols if the kernel will accept NFS requests from reserved ports only. 111c203da27SBruce M Simpson.It Fl p Ar port 112c203da27SBruce M SimpsonForce 113c203da27SBruce M Simpson.Nm 114c203da27SBruce M Simpsonto bind to the specified port, for both 115b18b186eSRuslan Ermilov.Dv AF_INET 116c203da27SBruce M Simpsonand 117b18b186eSRuslan Ermilov.Dv AF_INET6 118c203da27SBruce M Simpsonaddress families. 119c203da27SBruce M SimpsonThis is typically done to ensure that the port which 120c203da27SBruce M Simpson.Nm 121c203da27SBruce M Simpsonbinds to is a known quantity which can be used in firewall rulesets. 122c203da27SBruce M SimpsonIf 123c203da27SBruce M Simpson.Nm 124c203da27SBruce M Simpsoncannot bind to this port, an appropriate error will be recorded in 125c203da27SBruce M Simpsonthe system log, and the daemon will then exit. 126f93c028aSRick Macklem.It Fl R 127f93c028aSRick MacklemDo not support the Mount protocol and do not register with 128f93c028aSRick Macklem.Xr rpcbind 8 . 129f93c028aSRick MacklemThis can be done for NFSv4 only servers, since the Mount protocol is not 130f93c028aSRick Macklemused by NFSv4. 131f93c028aSRick MacklemUseful for NFSv4 only servers that do not wish to run 132f93c028aSRick Macklem.Xr rpcbind 8 . 133f93c028aSRick Macklem.Xr showmount 8 134f93c028aSRick Macklemwill not work, however since NFSv4 mounts are not shown by 135f93c028aSRick Macklem.Xr showmount 8 , 136f93c028aSRick Macklemthis should not be an issue for an NFSv4 only server. 137a62dc406SDoug Rabson.It Fl r 13874853402SPhilippe CharnierAllow mount RPCs requests for regular files to be served. 13987564113SPeter WemmAlthough this seems to violate the mount protocol specification, 14087564113SPeter Wemmsome diskless workstations do mount requests for 14187564113SPeter Wemmtheir swapfiles and expect them to be regular files. 14287564113SPeter WemmSince a regular file cannot be specified in 14387564113SPeter Wemm.Pa /etc/exports , 14487564113SPeter Wemmthe entire file system in which the swapfiles resides 14587564113SPeter Wemmwill have to be exported with the 14687564113SPeter Wemm.Fl alldirs 14787564113SPeter Wemmflag. 1488fae3551SRodney W. Grimes.It Ar exportsfile 14974853402SPhilippe CharnierSpecify an alternate location 1508fae3551SRodney W. Grimesfor the exports file. 1513201fe06SPawel Jakub DawidekMore than one exports file can be specified. 152e6f3cb32SRick Macklem.It Fl S 153e6f3cb32SRick MacklemTell mountd to suspend/resume execution of the nfsd threads whenever 154e6f3cb32SRick Macklemthe exports list is being reloaded. 155e6f3cb32SRick MacklemThis avoids intermittent access 156e6f3cb32SRick Macklemerrors for clients that do NFS RPCs while the exports are being 157e6f3cb32SRick Macklemreloaded, but introduces a delay in RPC response while the reload 158e6f3cb32SRick Macklemis in progress. 159e6f3cb32SRick MacklemIf 160e6f3cb32SRick Macklem.Nm 161e6f3cb32SRick Macklemcrashes while an exports load is in progress, 162e6f3cb32SRick Macklem.Nm 163e6f3cb32SRick Macklemmust be restarted to get the nfsd threads running again, if this 164e6f3cb32SRick Macklemoption is used. 165*2e5c9eafSJoyu Liao.It Fl s 166*2e5c9eafSJoyu LiaoCause 167*2e5c9eafSJoyu Liao.Nm 168*2e5c9eafSJoyu Liaoto skip automatic binding to localhost for IPv4 and IPv6. 169*2e5c9eafSJoyu LiaoThis option is meaningless unless 170*2e5c9eafSJoyu Liao.Fl h 171*2e5c9eafSJoyu Liaohas also been used. 1728fae3551SRodney W. Grimes.El 1738fae3551SRodney W. Grimes.Pp 17474853402SPhilippe CharnierWhen 17574853402SPhilippe Charnier.Nm 17674853402SPhilippe Charnieris started, 1778fae3551SRodney W. Grimesit loads the export host addresses and options into the kernel 178fe27ded8SMike Pritchardusing the 1799432e798SRick Macklem.Xr nmount 2 180fe27ded8SMike Pritchardsystem call. 1818fae3551SRodney W. GrimesAfter changing the exports file, 18274853402SPhilippe Charniera hangup signal should be sent to the 18374853402SPhilippe Charnier.Nm 18474853402SPhilippe Charnierdaemon 1858fae3551SRodney W. Grimesto get it to reload the export information. 1868fae3551SRodney W. GrimesAfter sending the SIGHUP 18787564113SPeter Wemm(kill \-s HUP `cat /var/run/mountd.pid`), 18874853402SPhilippe Charniercheck the syslog output to see if 18974853402SPhilippe Charnier.Nm 19074853402SPhilippe Charnierlogged any parsing 1918fae3551SRodney W. Grimeserrors in the exports file. 192d599144dSGarrett Wollman.Pp 1939432e798SRick MacklemIf multiple instances of 1949432e798SRick Macklem.Nm 1959432e798SRick Macklemare being run, either in multiple jails or both within 1969432e798SRick Macklemand outside of a jail, care must be taken to export 1979432e798SRick Macklemany given file system in only one of the instances. 1989432e798SRick MacklemNote that the 1999432e798SRick Macklem.Va allow.nfsd 2009432e798SRick Macklemjail parameter is required to allow 2019432e798SRick Macklem.Nm 2029432e798SRick Macklemto run in a jail. 2039432e798SRick MacklemSee 2049432e798SRick Macklem.Xr jail 8 2059432e798SRick Macklemfor more information. 2069432e798SRick Macklem.Pp 207d599144dSGarrett WollmanIf 20874853402SPhilippe Charnier.Nm 209d599144dSGarrett Wollmandetects that the running kernel does not include 210d599144dSGarrett Wollman.Tn NFS 211d599144dSGarrett Wollmansupport, it will attempt to load a loadable kernel module containing 212d599144dSGarrett Wollman.Tn NFS 213d599144dSGarrett Wollmancode, using 214933abef0SMaxime Henrion.Xr kldload 2 . 215d599144dSGarrett WollmanIf this fails, or no 216d599144dSGarrett Wollman.Tn NFS 2175e0abc7bSGuy HelmerKLD was available, 21874853402SPhilippe Charnier.Nm 219d599144dSGarrett Wollmanexits with an error. 2209432e798SRick MacklemWhen run in a jail, the 2219432e798SRick Macklem.Xr kldload 2 2229432e798SRick Macklemmust be done outside the jail, typically by adding 2239432e798SRick Macklem.Dq nfsd 2249432e798SRick Macklemto 2259432e798SRick Macklem.Va kld_list 2269432e798SRick Macklemin the 2279432e798SRick Macklem.Xr rc.conf 5 2289432e798SRick Macklemfile on the jail host. 2298fae3551SRodney W. Grimes.Sh FILES 2308fae3551SRodney W. Grimes.Bl -tag -width /var/run/mountd.pid -compact 2318fae3551SRodney W. Grimes.It Pa /etc/exports 2328fae3551SRodney W. Grimesthe list of exported file systems 2338fae3551SRodney W. Grimes.It Pa /var/run/mountd.pid 2348fae3551SRodney W. Grimesthe pid of the currently running mountd 23508b48e64SAndreas Schulz.It Pa /var/db/mountdtab 23608b48e64SAndreas Schulzthe current list of remote mounted file systems 2378fae3551SRodney W. Grimes.El 2388fae3551SRodney W. Grimes.Sh SEE ALSO 2398fae3551SRodney W. Grimes.Xr nfsstat 1 , 240933abef0SMaxime Henrion.Xr kldload 2 , 241bcc1d071SRick Macklem.Xr nfsv4 4 , 2428fae3551SRodney W. Grimes.Xr exports 5 , 2439432e798SRick Macklem.Xr rc.conf 5 , 2449432e798SRick Macklem.Xr jail 8 , 2458fae3551SRodney W. Grimes.Xr nfsd 8 , 2468657581bSMaxim Sobolev.Xr rpcbind 8 , 2478fae3551SRodney W. Grimes.Xr showmount 8 2488fae3551SRodney W. Grimes.Sh HISTORY 2498fae3551SRodney W. GrimesThe 25074853402SPhilippe Charnier.Nm 251c0b0bcf4SMike Pritchardutility first appeared in 252c0b0bcf4SMike Pritchard.Bx 4.4 . 253