rpc.mountd(8)
๐ rpc.mountd(8) โ System Manager's Manual ๐
okay bestie, gather round, because we're about to talk about rpc.mountd, aka the NFS mount daemon, and she is lowkey the backbone of your whole NFS situation. this is the manual page, but make it make sense. let's go โจ
๐ธ NAME ๐ธ
rpc.mountd โ the NFS mount daemon. that's her. that's the whole name. iconic.
๐ SYNOPSIS ๐
/usr/sbin/rpc.mountd [options]
yes, she lives at /usr/sbin/rpc.mountd and she takes options. we'll get to those, don't worry. ๐
โจ DESCRIPTION โจ
so the rpc.mountd daemon implements the server side of the NFS MOUNT protocol โ which is, like, an NFS side protocol used by NFS version 2 [RFC1094] and NFS version 3 [RFC1813]. she also responds to requests from the Linux kernel to authenticate clients and to hand over details of access permissions. multitasking queen. ๐
the NFS server (nfsd) keeps a cache of authentication and authorization info, which it uses to figure out the source of each request, and then what access permissions that source has to any local filesystem. when the info it needs isn't in the cache, the server sends a request to mountd to fill in the missing bits. and mountd uses a table of information stored in /var/lib/nfs/etab โ maintained by exportfs(8), possibly based on the contents of exports(5) โ to respond to each request. it's giving "I got you, bestie." ๐ซถ
๐ฆ Mounting exported NFS File Systems ๐ฆ
the NFS MOUNT protocol has several procedures. the most important ones are MNT (mount an export) and UMNT (unmount an export).
a MNT request has two arguments:
- an explicit argument that contains the pathname of the root directory of the export to be mounted
- an implicit argument that is the sender's IP address
when she receives a MNT request from an NFS client, rpc.mountd checks both the pathname and the sender's IP address against her export table. if the sender is permitted to access the requested export, rpc.mountd returns an NFS file handle for the export's root directory to the client. then the client can use that root file handle plus NFS LOOKUP requests to navigate the directory structure of the export. slay. ๐ฅ
๐ The rmtab File ๐
the rpc.mountd daemon registers every successful MNT request by adding an entry to the /var/lib/nfs/rmtab file. and when she gets a UMNT request from an NFS client, rpc.mountd simply removes the matching entry from /var/lib/nfs/rmtab โ as long as the access control list for that export allows that sender to access the export. periodt.
clients can discover the list of file systems an NFS server is currently exporting, or the list of other clients that have mounted its exports, by using the showmount(8) command. showmount(8) uses other procedures in the NFS MOUNT protocol to report information about the server's exported file systems. cute, right? ๐
โ ๏ธ but note, bestie: there is little to guarantee that the contents of/var/lib/nfs/rmtabare accurate. a client may continue accessing an export even after invoking UMNT. and if the client reboots without sending a UMNT request, stale entries remain for that client in/var/lib/nfs/rmtab. so likeโฆ don't fully trust her. ๐
๐ง Mounting File Systems with NFSv4 ๐ง
version 4 (and later) of NFS does not use a separate NFS MOUNT protocol. instead, mounting is performed using regular NFS requests handled by the NFS server in the Linux kernel (nfsd). consequently, /var/lib/nfs/rmtab is not updated to reflect any NFSv4 activity. so if you were looking for rmtab entries from your NFSv4 mountsโฆ yeah, she's not there. ๐
โจ OPTIONS โจ
okay bestie, this is the good part. every single flag, no skips, let's go ๐
-d kindor--debug kindโ turns on debugging. the valid *kind*s are:all,auth,call,generalandparse. pick your fighter ๐-lor--log-authโ logs the responses to authentication and access requests that come fromnfsd. each response then gets cached by the kernel for 30 minutes (or whatever--ttlsays below), and gets refreshed after 15 minutes โ that's half the ttl time โ if the relevant client is still active. also, heads up:-lis literally equivalent to-d auth, so you can turn it on in/etc/nfs.confwithdebug = authinside the[mountd]section. no cap ๐ซถ
rpc.mountd always logs authentication responses to MOUNT requests when NFSv3 is used. but to get similar logs for NFSv4? you need this option. periodt.
-ior--cache-use-ipaddrโ normally each client IP address gets matched against each host identifier (name, wildcard, netgroup, etc) found in/etc/exports, and a combined identity is formed from all the matching identifiers. often lots of clients map to the same combined identity, so doing this mapping reduces the number of distinct access details the kernel has to store. specifying-isuppresses that mapping, so access to each filesystem is requested and cached separately for each client IP address. this can increase the burden of updating the cache slightly, but it can make the log messages from-lway easier to read. iykyk ๐-Tor--ttlโ provides a time-to-live (TTL) for cached info given to the kernel. the kernel will normally request an update if the info is needed after half of this time has expired. the number you give it is in seconds, and increasing it reduces the rate of cache update requests โ which is especially noticeable when those requests are logged with-l. but increasing it also means changes to hostname-to-address mappings can take longer to be noticed. the default TTL is 1800 (30 minutes). โฐ-For--foregroundโ run in foreground (do not daemonize). main character energy, stays in the room ๐-hor--helpโ display usage message. classic.-o numor--descriptors numโ sets the limit on the number of open file descriptors to num. the default is to leave the limit unchanged. don't touch it if you don't need it, fr fr.-N mountd-versionor--no-nfs-version mountd-versionโ use this to request thatrpc.mountddoes not offer certain versions of NFS. the current version ofrpc.mountdcan support NFS version 2, 3 and 4. if either one of these versions shouldn't be offered,rpc.mountdmust be invoked with the option--no-nfs-version <vers>. ๐ซ-nor--no-tcpโ don't advertise TCP for mount.-p numor-P numor--port numโ specifies the port number used for RPC listener sockets. if you don't specify this option,rpc.mountdwill try to consult/etc/services; if it gets a port successfully, it sets the same port for all listener sockets, otherwise it chooses a random ephemeral port for each listener socket.
this option can be used to fix the port value of rpc.mountd's listeners when NFS MOUNT requests must traverse a firewall between clients and servers. ๐ฅ
-H progor--ha-callout progโ specify a high availability callout program. this program receives callouts for all MOUNT and UNMOUNT requests, which letsrpc.mountdbe used in a High Availability NFS (HA-NFS) environment. ๐ซก
the callout program is run with 4 arguments:
mountorunmount, depending on the reason for the callout- the name of the client performing the mount
- the path that the client is mounting
- the number of concurrent mounts that we believe the client has of that path
this callout is not needed with 2.6 and later kernels. instead, mount thenfsdfilesystem on/proc/fs/nfsd. okay? okay. ๐
-s,--state-directory-path directoryโ specify a directory in which to place state information (etabandrmtab). if you don't specify this option, the default/var/lib/nfsis used. ๐๏ธ-r,--reverse-lookupโrpc.mountdtracks IP addresses in thermtabfile. when a DUMP request is made (by someone runningshowmount -a, for instance), it returns IP addresses instead of hostnames by default. this option causesrpc.mountdto perform a reverse lookup on each IP address and return that hostname instead.
โ ๏ธ enabling this can have a substantial negative effect on performance in some situations. be careful bestie ๐ญ
-t Nor--num-threads=Nor--num-threads Nโ specifies the number of worker threads thatrpc.mountdspawns. the default is 1 thread, which is probably enough. more threads are usually only needed for NFS servers that need to handle mount storms of hundreds of NFS mounts in a few seconds, or when your DNS server is slow or unreliable. ๐ช๏ธ-uor--no-udpโ don't advertise UDP for mounting.-V versionor--nfs-version versionโ use this to request thatrpc.mountdoffer certain versions of NFS. the current version ofrpc.mountdcan support both NFS version 2 and the newer version 3. โจ-vor--versionโ print the version ofrpc.mountdand exit.-cor--apply-root-credโ when mountd is asked to allow an NFSv3 mount to a subdirectory of the exported directory, it will check whether the user asking to mount has lookup rights to the directories below that exported directory. when performing that check, mountd will apply any root squash or all squash rules that were specified for that client.
performing lookup checks as the user requires that the mountd daemon be run as root, or that it be given CAP_SETUID and CAP_SETGID privileges so it can change its own effective user and effective group settings. when troubleshooting, please also note that LSM frameworks such as SELinux can sometimes prevent the daemon from changing the effective user/groups despite the capability settings. ๐
in earlier versions of mountd, the same checks were performed using the mountd daemon's root privileges, meaning it could authorise access to directories that are not normally accessible to the user requesting to mount them. this option enables that legacy behaviour.
note: if there's a need to provide access to specific subdirectories that aren't normally accessible to a client, it's always possible to add export entries that explicitly grant such access. that ability does not depend on this option being enabled. ๐
-gor--manage-gidsโ accept requests from the kernel to map user id numbers into lists of group id numbers for use in access control. an NFS request will normally (except when using Kerberos or other cryptographic authentication) contain a user-id and a list of group-ids. due to a limitation in the NFS protocol, at most 16 group ids can be listed. if you use the-gflag, then the list of group ids received from the client will be replaced by a list of group ids determined by an appropriate lookup on the server. note that the 'primary' group id is not affected, so anewgroupcommand on the client will still be effective. this function requires a Linux Kernel with version at least 2.6.21. ๐ง-Lor--no-netlinkโ disable the use of netlink for kernel communication and force the use of the legacy/proc/net/rpcinterfaces instead. this can be useful for debugging or working around kernel netlink issues. ๐ง
๐ธ CONFIGURATION FILE ๐ธ
lots of the options you can set on the command line can also be controlled through values set in the [mountd] section โ or, in some cases, the [nfsd] section โ of the /etc/nfs.conf configuration file. โจ
values recognized in the [mountd] section include manage-gids, no-netlink, cache-use-ipaddr, descriptors, port, threads, ttl, reverse-lookup, and state-directory-path, ha-callout โ and each of them has the same effect as the option with the same name. cute, right? ๐
the values recognized in the [nfsd] section include TCP, UDP, vers3, and vers4, which each have the same meaning as given by rpc.nfsd(8).
๐ก๏ธ TCP_WRAPPERS SUPPORT ๐ก๏ธ
you can protect your rpc.mountd listeners using the tcp_wrapper library or iptables(8). iconic.
note that the tcp_wrapper library supports only IPv4 networking. ๐
add the hostnames of NFS peers that are allowed to access rpc.mountd to /etc/hosts.allow. use the daemon name mountd โ even if the rpc.mountd binary has a different name. yes, really. ๐
hostnames used in either access file will be ignored when they can't be resolved into IP addresses. for further information see the tcpd(8) and hosts_access(5) man pages.
๐ IPv6 and TI-RPC support ๐
TI-RPC is a pre-requisite for supporting NFS on IPv6. if TI-RPC support is built into rpc.mountd, it attempts to start listeners on network transports marked 'visible' in /etc/netconfig. as long as at least one network transport listener starts successfully, rpc.mountd will operate. ๐ฆ
๐ FILES ๐
/etc/exportsโ input file forexportfs, listing exports, export options, and access control lists/var/lib/nfs/rmtabโ table of clients accessing server's exports
๐ SEE ALSO ๐
exportfs(8), exports(5), showmount(8), rpc.nfsd(8), rpc.rquotad(8), nfs(5), nfs.conf(5), tcpd(8), hosts_access(5), iptables(8), netconfig(5)
- RFC 1094 - "NFS: Network File System Protocol Specification"
- RFC 1813 - "NFS Version 3 Protocol Specification"
- RFC 7530 - "Network File System (NFS) Version 4 Protocol"
- RFC 8881 - "Network File System (NFS) Version 4 Minor Version 1 Protocol"
๐ AUTHOR ๐
Olaf Kirch, H. J. Lu, G. Allan Morris III, and a host of others.
and that's the whole thing bestie, we ate that entire manpage and left zero crumbs ๐ the footer says this page is from 31 Dec 2009 and lives at rpc.mountd(8) โ a certified vintage icon, no notes, periodt ๐ โจ
๐ฆ where this page comes from
- arch rolling: nfs-utils 3.1.1-1 ยท GPL-2.0-or-later
- nixos 26.05: nfs-utils 2.9.1
- nixpkgs unstable: nfs-utils 3.1.1
- ubuntu stonking: nfs-kernel-server 1:2.9.1-1ubuntu1
- Copyright (C) 1999 Olaf Kirch <okir@monad.swb.de>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms