MOUNT_NFS(8)
🌸 MOUNT_NFS(8) — NAME 🌸
okay bestie, so this is the mount_nfs(8) page from the System Manager's Manual — yes, the whole thing, MOUNT_NFS(8), capital letters and all. it's the vibe check on mount_nfs, and we're about to go deep.
mount_nfs — mount NFS file systems 💖
✨ SYNOPSIS ✨
mount_nfs [-23bcdiLlNPsTU] [-a maxreadahead] [-D deadthresh]
[-g maxgroups] [-I readdirsize] [-o options] [-R retrycnt]
[-r readsize] [-t timeout] [-w writesize] [-x retrans]
rhost:path node
like, look at her go. absolute main character energy. 🌈
🦋 DESCRIPTION 🦋
so mount_nfs calls the nmount(2) system call to prep and graft a remote NFS file system (rhost:path) onto the file system tree at the point node. that's the whole mission. 🫶
this command is normally executed by mount(8) — like, you don't usually summon her directly, she comes with the group. for NFSv2 and NFSv3, she implements the mount protocol as described in RFC 1094, Appendix A and RFC 1813, Appendix I. for NFSv4, she uses the NFSv4 protocol as described in RFC 7530, RFC 5661 and RFC 7862. no cap, those are the receipts. 📚
by default, mount_nfs keeps retrying until the mount succeeds. and like… that's on purpose — this behaviour is intended for file systems listed in fstab(5) that are critical to the boot process. 👑 for non-critical file systems, the bg and retrycnt options provide mechanisms to keep the boot process from hanging if the server is unavailable. bestie, do not skip those. seriously. 💀
if the server becomes unresponsive while an NFS file system is mounted, any new or outstanding file operations on that file system will hang uninterruptibly until the server comes back. like, just… hanging. forever. no vibe. to modify this default behaviour, see the intr and soft options. 🙈
the options are:
-o— options are specified with a-oflag followed by a comma separated string of options. see themount(8)man page for possible options and their meanings. the following NFS specific options are also available:acregmin=⟨seconds⟩,acregmax=⟨seconds⟩,acdirmin=⟨seconds⟩,acdirmax=⟨seconds⟩— when attributes of files are cached, a timeout is calculated to determine whether a given cache entry has expired. these four values determine the upper and lower bounds of the timeouts for “directory” attributes and “regular” (ie: everything else) attributes. the default values are 3 -> 60 seconds for regular files, and 30 -> 60 seconds for directories. the algorithm to calculate the timeout is based on the age of the file. the older the file, the longer the cache is considered valid, subject to the limits above. ⏳actimeo=⟨seconds⟩— set four cache timeouts above to the specified value. one number, four timeouts. efficiency queen. 💅allgssname— this option can be used along with-o gssnameto specify that all operations should use the host-based initiator credential. this may be used for clients that run system daemons that need to access files on the NFSv4 mounted volume. 🎀bg— if an initial attempt to contact the server fails, fork off a child to keep trying the mount in the background. useful forfstab(5), where the file system mount is not critical to multiuser operation. go do your thing offscreen, queen. 🦋bgnow— likebg, fork off a child to keep trying the mount in the background, but do not attempt to mount in the foreground first. this eliminates a 60+ second timeout when the server is not responding. useful for speeding up the boot process of a client when the server is likely to be unavailable. this is often the case for interdependent servers such as cross-mounted servers (each of two servers is an NFS client of the other) and for cluster nodes that must boot before the file servers. honestly iconic behaviour. 🔥deadthresh=⟨value⟩— set the “dead server threshold” to the specified number of round trip timeout intervals before a “server not responding” message is displayed. 💀dumbtimer— turn off the dynamic retransmit timeout estimator. this may be useful for UDP mounts that exhibit high retry rates, since it is possible that the dynamically estimated timeout interval is too short. ngl, the name is a choice, but she's just doing her job. 😭fg— same as not specifyingbg. simple. clean. lowkey perfect. ✨gssname=⟨service-principal-name⟩— this option can be used with the KerberosV security flavors for NFSv4 mounts to specify the “service-principal-name” of a host-based entry in the default keytab file that is used for system operations. it allows the mount to be performed by “root” and avoids problems with cached credentials for the system operations expiring. the “service-principal-name” should be specified without instance or domain and is typicallyhost,nfsorroot, although the form⟨service⟩@ ⟨fqdn⟩can also be used if the local system'sgethostname(3)value does not match the host-based principal in the keytab. 🔑hard— same as not specifyingsoft. the mount is hard. she commits. 💜intr— make the mount interruptible, which implies that file system calls that are delayed due to an unresponsive server will fail withEINTRwhen a termination signal is posted for the process. to avoid leaving file locks in an indeterminate state on the NFS server, it is recommended that thenolockdoption be used with this option. > bestie this is the "please let me out" button, and yes, you do wantnolockdwith it. 🙏maxgroups=⟨value⟩— set the maximum size of the group list for the credentials to the specified value. this should be used for mounts on old servers that cannot handle a group list size of 16, as specified in RFC 1057. try 8, if users in a lot of groups cannot get response from the mount point. vintage server problems fr fr. 🍓mountport=⟨value⟩— specify the port number to be used to communicate withmountd(8)on the NFS server. this option allows an NFSv2 or NFSv3 mount to be done without the need to run therpcbind(8)service. this option is meaningless for an NFSv4 mount, since NFSv4 does not use the Mount protocol. ⭐mntudp— force the mount protocol to use UDP transport, even for TCP NFS mounts. (necessary for some old BSD servers.) ancient server support stays winning. 🧚nametimeo=⟨value⟩— override the default ofNFS_DEFAULT_NAMETIMEOfor the timeout (in seconds) for positive name cache entries. if this is set to 0 it disables positive name caching for the mount point. 🎀negnametimeo=⟨value⟩— override the default ofNFS_DEFAULT_NEGNAMETIMEOfor the timeout (in seconds) for negative name cache entries. if this is set to 0 it disables negative name caching for the mount point. (yes, the "nope, doesn't exist" cache has feelings too.) 🙈nconnect=⟨value⟩— specify the number of TCP connections (1-16) to be used for an NFS Version 4, minor version 1 or 2 mount. multiple TCP connections can provide more client to server network bandwidth for certain network configurations such as:- Multiple network interfaces that are aggregated together.
- A fast network interface that uses multiple queues.
the first TCP connection will be used for all RPCs that consist entirely of small RPC messages. the RPCs that can have large RPC messages (Read/Readdir/Write) are distributed over the additional TCP connections in a round robin fashion. this option will result in more IP port#s being used. this option requires the nfsv4 option. note that for NFS servers such as AmazonEFS, where each new TCP connection can connect to a different cluster that maintains lock state separately, this option cannot be used. 🔥
nfsv2— use the NFS Version 2 protocol (the default is to try version 3 first then version 2). note that NFS version 2 has a file size limit of 2 gigabytes. ⚠️ like, actually remember that one.nfsv3— use the NFS Version 3 protocol. the standard queen. 👑nfsv4— use the NFS Version 4 protocol. this option will force the mount to use TCP transport. by default, the highest minor version of NFS Version 4 that is supported by the NFS Version 4 server will be used. see theminorversionoption. make sure that all your NFS Version 4 clients have unique values in/etc/hostid. 🫶minorversion=⟨value⟩— use the specified minor version for a NFS Version 4 mount, overriding the default. the minor versions supported are 0, 1, and 2. this option is only meaningful when used with thenfsv4option. 💅oneopenown— make a minor version 1 or 2 of the NFS Version 4 protocol mount use a single OpenOwner for all Opens. this may be useful for a server with a very low limit on OpenOwners, such as AmazonEFS. it may be required when an accumulation of NFS version 4 Opens occurs, as indicated by the “Opens” count displayed bynfsstat(1)with the-cand-Ecommand-line options. a common case for an accumulation of Opens is a shared library within the NFS mount that is used by several processes, where at least one of these processes is always running. this option cannot be used for an NFS Version 4, minor version 0 mount. it may not work correctly when Delegations are being issued by a server, but note that the AmazonEFS server does not issue delegations at this time. this option is only meaningful when used with thenfsv4option. 😭 the shared-library-opens thing gets everyone.pnfs— enable support for parallel NFS (pNFS) for minor version 1 or 2 of the NFS Version 4 protocol. this option is only meaningful when used with thenfsv4option. parallel. NFS. she's doing the most and we love her. 🌈noac— disable attribute caching. straight up. no notes. 💀
noconn— for UDP mount points, do not do aconnect(2). bestie you must use this if the server doesn't reply to requests from the standard NFS port number2049, or if it replies to requests using a different IP address (which can happen if the server is multi-homed). setting thevfs.nfs.nfs_ip_paranoiasysctl to0will make this option the default. ✨nocto— okay so normally NFS clients maintain close-to-open cache coherency. how? by flushing at close time and checking at open time. checking at open time is implemented by getting attributes from the server and purging the data cache if they don't match attributes cached by the client.
this option disables checking at open time. it may improve performance for read-only mounts, but should only be used if the data on the server changes rarely. be sure to understand the consequences before enabling this option. 😭
noinet4,noinet6— disablesAF_INETorAF_INET6connections. useful for hosts that have both anArecord and anAAAArecord for the same name.nolockd— do not forwardfcntl(2)locks over the wire via theNLMprotocol forNFSv3mounts or via theNFSv4protocol forNFSv4mounts. all locks will be local and not seen by the server and likewise not seen by other NFS clients forNFSv3orNFSv4mounts. this removes the need to run therpcbind(8)service and therpc.statd(8)andrpc.lockd(8)servers on the client forNFSv3mounts.
note that this option will only be honored when performing the initial mount, it will be silently ignored if used while updating the mount options. also note that NFSv4 mounts do not use these daemons. the NFSv4 protocol handles locks, unless this option is specified.
noncontigwr— this mount option allows the NFS client to combine non-contiguous byte ranges being written such that the dirty byte range becomes a superset of the bytes that are dirty. this reduces the number of writes significantly for software builds. the merging of byte ranges is not done if the file has been file locked, since most applications modifying a file from multiple clients will use file locking. as such, this option could result in a corrupted file for the rare case of an application modifying the file from multiple clients concurrently without using file locking. 💀 (so like, be careful)principal— for theRPCSEC_GSSsecurity flavors, such askrb5,krb5iandkrb5p, this option sets the name of the host based principal name expected by the server. this option overrides the default, which will benfs@<server-fqdn>and should normally be sufficient. 🫶noresvport— do not use a reserved socket port number (see below). 👑port=⟨port_number⟩— use the specified port number for NFS requests. the default is to query the portmapper for the NFS port.proto=⟨protocol⟩— specify the transport protocol version to use. currently, they are:udp— use UDP over IPv4tcp— use TCP over IPv4udp6— use UDP over IPv6tcp6— use TCP over IPv6
rdirplus— used withNFSV3to specify that the ReaddirPlus RPC should be used. forNFSV4, setting this option has a similar effect, in that it will make the Readdir Operation get more attributes. this option reduces RPC traffic for cases such as “ls -l”, but tends to flood the attribute and name caches with prefetched entries. try this option and see whether performance improves or degrades. probably most useful for client to server network interconnects with a large bandwidth times delay product. 🌈readahead=⟨value⟩— set the read-ahead count to the specified value. this may be in the range of0-4, and determines how many blocks will be read ahead when a large file is being read sequentially. trying a value greater than1for this is suggested for mounts with a large bandwidth * delay product. ⭐readdirsize=⟨value⟩— set the readdir read size to the specified value. the value should normally be a multiple ofDIRBLKSIZthat is <= the read size for the mount.resvport— use a reserved socket port number. this flag is obsolete, and only retained for compatibility reasons. reserved port numbers are used by default now. (for the rare case where the client has a trusted root account but untrustworthy users and the network cables are in secure areas this does help, but for normal desktop clients this does not apply.) 💅retrans=⟨value⟩— set the retransmit timeout count for soft mounts to the specified value.retrycnt=⟨count⟩— set the mount retry count to the specified value. the default is a retry count of zero, which means to keep retrying forever. there is a60second delay between each attempt. 😭rsize=⟨value⟩— set the read data size to the specified value. it should normally be a power of2greater than or equal to1024. this should be used for UDP mounts when the “fragments dropped due to timeout” value is getting large while actively using a mount point. (usenetstat(1)with the-soption to see what the “fragments dropped due to timeout” value is.) 🔥sec=⟨flavor⟩— this option specifies what security flavor should be used for the mount. currently, they are:krb5— use KerberosV authenticationkrb5i— use KerberosV authentication and apply integrity checksums to RPCskrb5p— use KerberosV authentication and encrypt the RPC datasys— the defaultAUTH_SYS, which uses auid+gidlist authenticator
soft— a soft mount, which implies that file system calls will fail afterretrycntround trip timeout intervals.syskrb5— this option specifies that a KerberosVNFSv4minor version1or2mount usesAUTH_SYSfor system operations. using this option avoids the need for a KerberosV mount to have a host-based principal entry in the default keytab file (nogssnameoption) or a requirement for the user doing the mount to have a valid KerberosV ticket granting ticket (TGT) when the mount is done. this option is intended to be used with thesec=krb5andtlsoptions and can only be used forNFSv4mounts with minor version1or2. 🎀tcp— use TCP transport. this is the default option, as it provides for increased reliability on both LAN and WAN configurations compared to UDP. some old NFS servers do not support this method; UDP mounts may be required for interoperability. 👑timeout=⟨value⟩— set the initial retransmit timeout to the specified value, expressed in tenths of a second. may be useful for fine tuning UDP mounts over internetworks with high packet loss rates or an overloaded server. try increasing the interval ifnfsstat(1)shows high retransmit rates while the file system is active or reducing the value if there is a low retransmit rate but long response delay observed. (normally, thedumbtimeroption should be specified when using this option to manually tune the timeout interval.) ⏱️timeo=⟨value⟩— alias fortimeout.tls— this option specifies that the connection to the server must use TLS perRFC 9289. TLS is only supported for TCP connections and therpc.tlsclntd(8)daemon must be running for an NFS over TCP connection to use TLS. 🔒tlscertname=⟨name⟩— this option specifies the name of an alternate certificate to be presented to the NFS server during TLS handshake. the default certificate file names are “cert.pem” and “certkey.pem”. when this option is specified,namereplaces “cert” in the above file names. for example, if the value ofnameis specified as “other” the certificate file names to be used will be “other.pem” and “otherkey.pem”. these files are stored in/etc/rpc.tlsclntdby default. this option is only meaningful when used with thetlsoption and therpc.tlsclntd(8)is running with the-mcommand line flag set. 🦋udp— use UDP transport.vers=⟨vers_number⟩— use the specified version number for NFS requests. see thenfsv2,nfsv3, andnfsv4options for details.wcommitsize=⟨value⟩— set the maximum pending write commit size to the specified value. this determines the maximum amount of pending write data that the NFS client is willing to cache for each file. 💖wsize=⟨value⟩— sets the write data size to whatever value you pass 🎀 same energy as thersizeoption, except the number you're watching goes the other way: you check the "fragments dropped due to timeout" counter on the server, not on the client. and honestly? bothrsizeandwsizeare a last-ditch, break-glass-in-case-of-emergency move for beefing up performance when you're mounting servers that don't do TCP mounts. use them as a last resort, not a personality trait, iykyk 💅
✨ IMPLEMENTATION NOTES ✨
okay so when you don't specify either rsize or wsize, the I/O size just becomes the biggest value that both the NFS client and the server can vibe with. and the client's ceiling? that's defined by the tunable vfs.maxbcachebuf, which you can set to a power of two up to kern.maxphys. math! 🧮
and if you ever wanna peek at what mount options are actually in use for a given mount instead of what you think you typed, run nfsstat(1) with the -m command line option. it'll show you the receipts 📋✨
🌈 COMPATIBILITY 🌈
these command line flags are literally the same thing as -o named options — they're kept around so older installations don't throw a fit. legacy support, but make it cute 💖
-2— same as-o nfsv2-3— same as-o nfsv3-D— same as-o deadthresh-I— same as-o readdirsize=⟨value⟩-L— same as-o nolockd-N— same as-o noresvport-P— use a reserved socket port number. this flag is obsolete, bestie, it's only still here for compatibility reasons. (for that rare ✨special✨ case where the client has a trusted root account but untrustworthy users and the network cables live in secure areas, this genuinely does help — but for normal desktop clients? not it. doesn't apply 🙈)-R— same as-o retrycnt=⟨value⟩-T— same as-o tcp-U— same as-o mntudp-a— same as-o readahead=⟨value⟩-b— same as-o bg-c— same as-o noconn-d— same as-o dumbtimer-g— same as-o maxgroups-i— same as-o intr-l— same as-o rdirplus-r— same as-o rsize=⟨value⟩-s— same as-o soft-t— same as-o retransmit=⟨value⟩(deprecated, fyi 💀)-w— same as-o wsize=⟨value⟩-x— same as-o retrans=⟨value⟩
and the following -o named options are equivalent to other -o named options — these exist so that using autofs(4) support doesn't feel weird if you're coming from other operating systems (think Linux, Solaris, and OSX). cross-platform friendship 🫶
-o vers=2— same as-o nfsv2-o vers=3— same as-o nfsv3-o vers=4— same as-o nfsv4
🌸 SEE ALSO 🌸
go read these, they're iconic in their own right 👑
nfsstat(1), nmount(2), unmount(2), lagg(4), nfsv4(4), fstab(5), gssd(8), mount(8), nfsd(8), nfsiod(8), rpcbind(8), rpc.tlsclntd(8), showmount(8)
🦋 HISTORY 🦋
a version of the mount_nfs utility showed up in 4.4BSD. vintage! truly a classic, we love an elder icon ⭐
💀 BUGS 💀
this is the part where I hold your hand, bestie, because it's important 🫶
so NFSv4 does open/lock operations whose ordering is strictly enforced by the server — meaning the options intr and soft cannot be safely used. like, at all. don't do it. 😭
for NFSv4 minor version 1 or 2 mounts, that ordering happens via session slots, and the NFSv4 client now handles broken session slots fairly well. so if you use nolockd together with intr and/or soft, an NFSv4 minor version 1 or 2 mount should work fairly well — emphasis on fairly, it's still not completely correct, ngl 🙈
and for NFSv4 minor version 0 mounts? hard mounts without the intr mount option are strongly recommended. that's not a suggestion, that's the vibe check ✅
and that's a wrap on MOUNT_NFS(8), bestie!! 💖 this page came from Debian and it's dated November 29, 2024 — go mount something responsibly, and remember: hard mounts, no intr, no cap 🎀✨💅
📦 where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1992, 1993, 1994, 1995 The Regents of the University of California. All rights reserved
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms