NFSDCTL(8)

nfsdctl(8) β€” yes bestie, we're reading the man page, and honestly? it's giving control panel for the Linux kernel NFS server πŸ’–

✨ NAME ✨

nfsdctl β€” control program for the Linux kernel NFS server πŸ”₯


πŸ¦‹ SYNOPSIS πŸ¦‹

nfsdctl [ OPTION ] COMMAND ...

🌸 DESCRIPTION 🌸

okay so nfsdctl is a control and query program for the in-kernel NFS server. no cap. there are several subcommands (they're all documented down below, don't worry) that let the admin configure or query different aspects of the NFS server. you're basically the main character running the whole vibe. πŸ‘‘

to get the tea on how any particular subcommand works, just pass that subcommand the --help parameter. like so:

nfsdctl listener --help

πŸ’… OPTIONS πŸ’…

  • -d, --debug β€” turns on debug logging πŸ›
  • -h, --help β€” prints the program help text 🫢
  • -s, --syslog β€” logs to syslog instead of to stderr (and stderr is the default, fyi) πŸ“
  • -V, --version β€” prints the program version ⭐

πŸŽ€ SUBCOMMANDS πŸŽ€

each subcommand can also accept its own lil set of options and arguments. and the --help option? standard for all of them, periodt. πŸ’…

🌈 autostart

starts the server using the settings in the [nfsd] section of /etc/nfs.conf. this subcommand takes no arguments, it just goes. note that if a "threads=" value isn't set in nfs.conf, then 16 server threads will be brought online. sixteen. iconic default behavior. ✨

🌈 listener

gets/sets the listening sockets for the server. run this with no arguments and it hands you a list of the sockets the server is currently listening on. to add or remove sockets, you pass it whitespace-separated strings in this format:

{ +|- }{ protocol }:{ address }:{ port }

the fields are:

  • + to add a listener, - to remove one
  • protocol: protocol name (e.g. tcp, udp, rdma)
  • address: hostname or address
  • port: port number or service name

all fields are required, except for the address. if address is an empty string, then the listeners will be opened for INADDR_ANY and IN6ADDR_ANY_INIT for ipv6 (if enabled). the address can be either a hostname or an IP address. IPv4 addresses must be in dotted-quad form. IPv6 addresses should be in standard colon separated form, and must be enclosed in square brackets. no exceptions, bestie, the brackets are not optional 🫠

🌈 nlm

gets information about NLM (lockd) settings in the current net namespace. this subcommand takes no arguments. πŸ”’

🌈 status

gets information about RPCs currently executing in the server. this subcommand takes no arguments. πŸ‘€

🌈 threads

gets/sets the number of running nfsd threads in each pool. pass it a list of integers to change the currently active number of threads. passing it a value of 0 will shut down the NFS server β€” yes, really, that's the vibe, tread carefully 😭. run it without arguments to get the current number of running threads in each pool.

these options are specific to the threads subcommand:

  • -m, --min-threads= β€” if set to a positive, non-zero value, then dynamic threading is enabled for nfsd. in this mode, the traditional "threads" values are treated as a maximum number of threads. this specifies the minimum number of threads per pool. the kernel will start the minimum number and dynamically start and stop threads as needed. if the minimum is larger than the maximum, then dynamic threading is disabled, and the maximum number is started. 🀹
  • -k, --fh-key-file= β€” if set to the path of a file, use the first 128 bits of the sha1 hash of the file's contents as the server's filehandle signing key. exports with the "sign_fh" export option will use this key to append a signature to guard against filehandle guessing attacks. πŸ”

🌈 version

gets/sets the enabled NFS versions for the server. run without arguments to get a list of supported versions and whether they're currently enabled or disabled. to enable or disable a version, pass it a string in this format:

{ +|- }{ MAJOR }{.{ MINOR }}

the fields are:

  • + to enable a version, - to disable
  • MAJOR: the major version integer value
  • MINOR: the minor version integer value

the minorversion field is optional. if it's not given, it will disable or enable all minorversions for that major version. πŸͺ„

note that versions can only be set when there are no nfsd threads running. this is a hard requirement, not a suggestion, bestie.

🌈 pool-mode

gets/sets the host's pool mode. this will cause the server to start threads that are pinned to either the CPU or the NUMA node. this can only be set when there are no nfsd threads running. πŸ“Œ

the available options are:

  • global: single large pool
  • percpu: pool per CPU
  • pernode: pool per NUMA node
  • auto: choose a mode based on host configuration

πŸ“ EXAMPLES πŸ“

start the server with the settings in nfs.conf:

nfsdctl autostart

get a list of current listening sockets:

nfsdctl listener

show the supported and enabled NFS versions:

nfsdctl version

add TCP listener on all addresses (both v4 and v6), port 2049:

nfsdctl listener +tcp::2049

add RDMA listener on 1.2.3.4 port 20049:

nfsdctl listener +rdma:1.2.3.4:20049

add same listener on IPv6 address f00::ba4 port 20050:

nfsdctl listener +rdma:[f00::ba4]:20050

enable NFS version 3, disable v4.0:

nfsdctl version +3 -4.0

change the number of running threads in first pool to 256:

nfsdctl threads 256

set the pool-mode to "pernode":

nfsdctl pool-mode pernode

πŸ’œ NOTES πŸ’œ

nfsdctl is intended to supersede rpc.nfsd(8), which controls the nfs server using the files under /proc/fs/nfsd. nfsdctl instead uses a netlink(7) interface to achieve the same goals. glow up, honestly. ✨

most of the commands that query the NFS server can be run as an unprivileged user, but configuring the server typically requires an account with elevated privileges. so like, look but don't touch, unless you've got the keys πŸ”‘

🧚 rpcbind registration 🧚

on a kernel that supports it, nfsdctl registers the NFS and NFSACL programs with the local rpcbind itself. the kernel made those calls while it held an internal mutex, where a slow rpcbind blocked every other NFSD netlink command. nfsdctl detects support and needs no configuration. it just knows. 🫢

nfsdctl registers the listeners after it sets them, and it clears the entries when the last thread stops. a failed registration is not fatal. the server starts, but a client that looks the server up in rpcbind cannot find it. NFSv4 does not need rpcbind, and a v2 or v3 client that already knows the port does not need it either. so it's fine, it's fine, it's giving "we move" 😌

RDMA listeners are not registered, which matches what the kernel did.

lockd still registers NLM itself on every kernel. every single one. no skips. πŸ’€


🌟 SEE ALSO 🌟

nfs.conf(5), rpc.nfsd(8), rpc.mountd(8), exports(5), exportfs(8), rpc.rquotad(8), nfsstat(8), netconfig(5)


πŸ‘‘ AUTHOR πŸ‘‘

Jeff Layton


and that's the whole page, bestie β€” this one's from 2026-01-12 and it's the NFSDCTL(8) manual, so go forth and configure your kernel NFS server with main character energy πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from