NFSMOUNT.CONF(5)

πŸ“¦
version 3.1.1 Β· 3 versions
, in arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NFSMOUNT.CONF(5) β€” the file formats manual glow-up πŸ’–

okay bestie, buckle up, because we're about to talk about nfsmount.conf, the configuration file for NFS mounts. yes, THE file formats manual. she's a section 5 icon and she's here to let you set options globally, per server, or per mount point. let's get into it 🫢


✨ SYNOPSIS ✨

this is the configuration file for NFS mounts, and the whole point of her existence is that she lets options be set globally, per server or per mount point. that's the vibe. that's the whole assignment.

Configuration file for NFS mounts that allows options to be set
globally, per server or per mount point.

🌸 DESCRIPTION 🌸

so the tea is this: the config file is made up of multiple section headers, and then right after each one come the variable assignments that belong to that section. simple. clean. organized. we love a structured queen πŸ‘‘

a section header is literally just a string chillin' inside [ and ] brackets. iconic.

a variable assignment is an assignment statement that gives a value to a particular variable using the = operator, like Proto=Tcp. slay.

and which variables can you assign? great question, bestie:

  • the whole set of NFS specific mount options listed in nfs(5)
  • plus the filesystem-independent mount options listed in mount(8)
  • plus three bonus additions:
    • Sloppy=True β€” hits exactly the same as the -s option to mount
    • Foreground=True β€” same effect as fg
    • Background=True β€” same effect as bg
options in the config file can be written in UPPER, lower, or MiXeD case β€” she's flexible like that β€” and they all get shifted to lower case before being passed to the filesystem. no cap.

and now, a lil rule that WILL trip you up if you skip it: boolean mount options that don't need an equals sign must still be given as option=True. you can't just throw the bare option in there, and you also can't do the whole "prepend it with no" thing. nope. instead of no-ing an option, you write its negation as option=False. that's the rule. periodt πŸ’…


πŸŽ€ the three section categories πŸŽ€

sections get broken up into three basic categories: Global options, Server options and Mount Point options. here's the rundown:

  • [ NFSMount_Global_Options ] β€” this statically named section defines all the global mount options that can be applied to every single NFS mount. she's the main character, she applies to everyone.
  • [ Server "Server_Name" ] β€” this section defines all the mount options that should be used on mounts to a particular NFS server. the "Server_Name" string needs to be surrounded by " quotes, and it has to be an exact match (ignoring case, so she's chill about capitalization) of the server name used in the mount command.
  • [ MountPoint "Mount_Point" ] β€” this section defines all the mount options that should be used on a particular mount point. the "Mount_Point" string needs to be surrounded by " quotes and be an exact match of the mount point used in the mount command. and yes, even though path names are usually case-sensitive, the Mount_Point name is matched insensitive to case. plot twist, but a cute one.

πŸ”₯ the order of operations (very important, don't skip) πŸ”₯

the sections are processed in the reverse of the order listed above. and any options already seen β€” whether they showed up in a previous section or on the command line β€” get ignored when they're seen again. so if you set something twice, the first one wins. that's just how she moves. πŸ’€


🌈 EXAMPLES 🌈

here are some example lines of how sections and variables are defined in the config file. chef's kiss, honestly.

[ NFSMount_Global_Options ]
    Proto=Tcp

the TCP/IPv4 protocol will be used on every NFS mount. every single one. she said all of them.


[ Server "nfsserver.foo.com" ]
    rsize=32k
    wsize=32k
    proto=udp6

a 32k (32768 bytes) block size will be used as the read and write size on all mounts to the 'nfsserver.foo.com' server. and UDP/IPv6 is the protocol to be used. look at her, being all specific and per-server about it ✨


[ MountPoint "/export/home" ]
    Background=True

all mounts to the '/export/home' export will be performed in the background (i.e. done asynchronously). multitasking queen behavior πŸ¦‹


πŸŽ€ FILES πŸŽ€

here's where these files live, bestie:

  • /usr/etc/nfsmount.conf
  • /usr/etc/nfsmount.conf.d/*.conf
  • /etc/nfsmount.conf
  • /etc/nfsmount.conf.d/*.conf

these are the default NFS mount configuration files, and here's the tea: variables set in the later file over-ride those in the earlier file. so the order up there? it matters. keep it in mind. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

nfs(5), mount(8),

go read those too, iykyk. they're the supporting cast and they ate.


⭐ quick vibe check reminder: if you forget the =True / =False thing for booleans, or you forget the quotes around your Server_Name / Mount_Point, or you forget that earlier options win β€” that's on you, not on her. she's been very clear. πŸ’–

and that's the whole page, bestie!! this one's from the File Formats Manual, dated 16 December 2020, and she goes by NFSMOUNT.CONF(5) β€” that's the source, the version, the date, the whole signature. mwah. πŸ’…βœ¨

πŸ“¦ where this page comes from