| 1 |
'\" t |
| 2 |
.\" Title: nfsdctl |
| 3 |
.\" Author: Jeff Layton |
| 4 |
.\" Generator: Asciidoctor 2.0.20 |
| 5 |
.\" Date: 2026-01-12 |
| 6 |
.\" Manual: \ \& |
| 7 |
.\" Source: \ \& |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "NFSDCTL" "8" "2026-01-12" "\ \&" "\ \&" |
| 11 |
.ie \n(.g .ds Aq \(aq |
| 12 |
.el .ds Aq ' |
| 13 |
.ss \n[.ss] 0 |
| 14 |
.nh |
| 15 |
.ad l |
| 16 |
.de URL |
| 17 |
\fI\\$2\fP <\\$1>\\$3 |
| 18 |
.. |
| 19 |
.als MTO URL |
| 20 |
.if \n[.g] \{\ |
| 21 |
. mso www.tmac |
| 22 |
. am URL |
| 23 |
. ad l |
| 24 |
. . |
| 25 |
. am MTO |
| 26 |
. ad l |
| 27 |
. . |
| 28 |
. LINKSTYLE blue R < > |
| 29 |
.\} |
| 30 |
.SH "NAME" |
| 31 |
nfsdctl \- control program for the Linux kernel NFS server |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
\fBnfsdctl\fP [ \fIOPTION\fP ] COMMAND ... |
| 35 |
.SH "DESCRIPTION" |
| 36 |
.sp |
| 37 |
nfsdctl is a control and query program for the in\-kernel NFS server. There are several |
| 38 |
subcommands (documented below) that allow the admin to configure or query different |
| 39 |
aspects of the NFS server. |
| 40 |
.sp |
| 41 |
To get information about different subcommand usage, pass the subcommand the |
| 42 |
\-\-help parameter. For example: |
| 43 |
.sp |
| 44 |
.if n .RS 4 |
| 45 |
.nf |
| 46 |
.fam C |
| 47 |
nfsdctl listener \-\-help |
| 48 |
.fam |
| 49 |
.fi |
| 50 |
.if n .RE |
| 51 |
.SH "OPTIONS" |
| 52 |
.sp |
| 53 |
\fB\-d, \-\-debug\fP |
| 54 |
.RS 4 |
| 55 |
Enable debug logging |
| 56 |
.RE |
| 57 |
.sp |
| 58 |
\fB\-h, \-\-help\fP |
| 59 |
.RS 4 |
| 60 |
Print program help text |
| 61 |
.RE |
| 62 |
.sp |
| 63 |
\fB\-s, \-\-syslog\fP |
| 64 |
.RS 4 |
| 65 |
Log to syslog instead of to stderr (the default) |
| 66 |
.RE |
| 67 |
.sp |
| 68 |
\fB\-V, \-\-version\fP |
| 69 |
.RS 4 |
| 70 |
Print program version |
| 71 |
.RE |
| 72 |
.SH "SUBCOMMANDS" |
| 73 |
.sp |
| 74 |
Each subcommand can also accept its own set of options and arguments. The |
| 75 |
\-\-help option is standard for all subcommands: |
| 76 |
.sp |
| 77 |
\fBautostart\fP |
| 78 |
.RS 4 |
| 79 |
Start the server using the settings in the [nfsd] section of /etc/nfs.conf. |
| 80 |
This subcommand takes no arguments. Note that if a "threads=" value is not set in |
| 81 |
nfs.conf, 16 server threads will be brought online. |
| 82 |
.RE |
| 83 |
.sp |
| 84 |
\fBlistener\fP |
| 85 |
.RS 4 |
| 86 |
Get/set the listening sockets for the server. Run this without arguments to |
| 87 |
get a list of the sockets on which the server is currently listening. To add |
| 88 |
or remove sockets, pass it whitespace\-separated strings in the format: |
| 89 |
.sp |
| 90 |
.if n .RS 4 |
| 91 |
.nf |
| 92 |
.fam C |
| 93 |
{ +|\- }{ protocol }:{ address }:{ port } |
| 94 |
.fam |
| 95 |
.fi |
| 96 |
.if n .RE |
| 97 |
.sp |
| 98 |
.if n .RS 4 |
| 99 |
.nf |
| 100 |
.fam C |
| 101 |
The fields are: |
| 102 |
.fam |
| 103 |
.fi |
| 104 |
.if n .RE |
| 105 |
.sp |
| 106 |
.if n .RS 4 |
| 107 |
.nf |
| 108 |
.fam C |
| 109 |
+ to add a listener, \- to remove one |
| 110 |
protocol: protocol name (e.g. tcp, udp, rdma) |
| 111 |
address: hostname or address |
| 112 |
port: port number or service name |
| 113 |
.fam |
| 114 |
.fi |
| 115 |
.if n .RE |
| 116 |
.sp |
| 117 |
.if n .RS 4 |
| 118 |
.nf |
| 119 |
.fam C |
| 120 |
All fields are required, except for the address. If address is an empty string, |
| 121 |
then the listeners will be opened for INADDR_ANY and IN6ADDR_ANY_INIT for ipv6 |
| 122 |
(if enabled). The address can be either a hostname or an IP address. IPv4 |
| 123 |
addresses must be in dotted\-quad form. IPv6 addresses should be in standard |
| 124 |
colon separated form, and must be enclosed in square brackets. |
| 125 |
.fam |
| 126 |
.fi |
| 127 |
.if n .RE |
| 128 |
.RE |
| 129 |
.sp |
| 130 |
\fBnlm\fP |
| 131 |
.RS 4 |
| 132 |
Get information about NLM (lockd) settings in the current net namespace. This |
| 133 |
subcommand takes no arguments. |
| 134 |
.RE |
| 135 |
.sp |
| 136 |
\fBstatus\fP |
| 137 |
.RS 4 |
| 138 |
Get information about RPCs currently executing in the server. This subcommand |
| 139 |
takes no arguments. |
| 140 |
.RE |
| 141 |
.sp |
| 142 |
\fBthreads\fP |
| 143 |
.RS 4 |
| 144 |
Get/set the number of running nfsd threads in each pool. Pass a list of |
| 145 |
integers to change the currently active number of threads. Passing it a |
| 146 |
value of 0 will shut down the NFS server. Run this without arguments to |
| 147 |
get the current number of running threads in each pool. |
| 148 |
.RE |
| 149 |
.sp |
| 150 |
.if n .RS 4 |
| 151 |
.nf |
| 152 |
.fam C |
| 153 |
These options are specific to the "threads" subcommand: |
| 154 |
|
| 155 |
\-m, \-\-min\-threads= |
| 156 |
If set to a positive, non\-zero value, then dynamic threading is enabled for |
| 157 |
nfsd. In this mode, the traditional "threads" values are treated as a maximum |
| 158 |
number of threads. This specifies the minimum number of threads per pool. The |
| 159 |
kernel will start the minimum number and dynamically start and stop threads as |
| 160 |
needed. If the minimum is larger than the maximum, then dynamic threadis is |
| 161 |
disabled, and the maximum number is started. |
| 162 |
|
| 163 |
\-k, \-\-fh\-key\-file= |
| 164 |
If set to the path of a file, use the first 128 bits of the sha1 hash |
| 165 |
of the file's contents as the server's filehandle signing key. |
| 166 |
Exports with the "sign_fh" export option will use this key to append an |
| 167 |
a signature to guard against filehandle guessing attacks. |
| 168 |
.fam |
| 169 |
.fi |
| 170 |
.if n .RE |
| 171 |
.sp |
| 172 |
\fBversion\fP |
| 173 |
.RS 4 |
| 174 |
Get/set the enabled NFS versions for the server. Run without arguments to |
| 175 |
get a list of supported versions and whether they are currently enabled or |
| 176 |
disabled. To enable or disable a version, pass it a string in the format: |
| 177 |
.sp |
| 178 |
.if n .RS 4 |
| 179 |
.nf |
| 180 |
.fam C |
| 181 |
{ +|\- }{ MAJOR }{.{ MINOR }} |
| 182 |
.fam |
| 183 |
.fi |
| 184 |
.if n .RE |
| 185 |
.sp |
| 186 |
.if n .RS 4 |
| 187 |
.nf |
| 188 |
.fam C |
| 189 |
The fields are: |
| 190 |
.fam |
| 191 |
.fi |
| 192 |
.if n .RE |
| 193 |
.sp |
| 194 |
.if n .RS 4 |
| 195 |
.nf |
| 196 |
.fam C |
| 197 |
+ to enable a version, \- to disable |
| 198 |
MAJOR: the major version integer value |
| 199 |
MINOR: the minor version integer value |
| 200 |
.fam |
| 201 |
.fi |
| 202 |
.if n .RE |
| 203 |
.sp |
| 204 |
.if n .RS 4 |
| 205 |
.nf |
| 206 |
.fam C |
| 207 |
The minorversion field is optional. If not given, it will disable or enable |
| 208 |
all minorversions for that major version. |
| 209 |
.fam |
| 210 |
.fi |
| 211 |
.if n .RE |
| 212 |
.sp |
| 213 |
.if n .RS 4 |
| 214 |
.nf |
| 215 |
.fam C |
| 216 |
Note that versions can only be set when there are no nfsd threads running. |
| 217 |
.fam |
| 218 |
.fi |
| 219 |
.if n .RE |
| 220 |
.RE |
| 221 |
.sp |
| 222 |
\fBpool\-mode\fP |
| 223 |
.RS 4 |
| 224 |
Get/set the host\(cqs pool mode. This will cause the server to start threads |
| 225 |
that are pinned to either the CPU or the NUMA node. This can only be set |
| 226 |
when there are no nfsd threads running. |
| 227 |
.sp |
| 228 |
.if n .RS 4 |
| 229 |
.nf |
| 230 |
.fam C |
| 231 |
The available options are: |
| 232 |
global: single large pool |
| 233 |
percpu: pool per CPU |
| 234 |
pernode: pool per NUMA node |
| 235 |
auto: choose a mode based on host configuration |
| 236 |
.fam |
| 237 |
.fi |
| 238 |
.if n .RE |
| 239 |
.RE |
| 240 |
.SH "EXAMPLES" |
| 241 |
.sp |
| 242 |
Start the server with the settings in nfs.conf: |
| 243 |
.sp |
| 244 |
.if n .RS 4 |
| 245 |
.nf |
| 246 |
.fam C |
| 247 |
nfsdctl autostart |
| 248 |
.fam |
| 249 |
.fi |
| 250 |
.if n .RE |
| 251 |
.sp |
| 252 |
Get a list of current listening sockets: |
| 253 |
.sp |
| 254 |
.if n .RS 4 |
| 255 |
.nf |
| 256 |
.fam C |
| 257 |
nfsdctl listener |
| 258 |
.fam |
| 259 |
.fi |
| 260 |
.if n .RE |
| 261 |
.sp |
| 262 |
Show the supported and enabled NFS versions: |
| 263 |
.sp |
| 264 |
.if n .RS 4 |
| 265 |
.nf |
| 266 |
.fam C |
| 267 |
nfsdctl version |
| 268 |
.fam |
| 269 |
.fi |
| 270 |
.if n .RE |
| 271 |
.sp |
| 272 |
Add TCP listener on all addresses (both v4 and v6), port 2049: |
| 273 |
.sp |
| 274 |
.if n .RS 4 |
| 275 |
.nf |
| 276 |
.fam C |
| 277 |
nfsdctl listener +tcp::2049 |
| 278 |
.fam |
| 279 |
.fi |
| 280 |
.if n .RE |
| 281 |
.sp |
| 282 |
Add RDMA listener on 1.2.3.4 port 20049: |
| 283 |
.sp |
| 284 |
.if n .RS 4 |
| 285 |
.nf |
| 286 |
.fam C |
| 287 |
nfsdctl listener +rdma:1.2.3.4:20049 |
| 288 |
.fam |
| 289 |
.fi |
| 290 |
.if n .RE |
| 291 |
.sp |
| 292 |
Add same listener on IPv6 address f00::ba4 port 20050: |
| 293 |
.sp |
| 294 |
.if n .RS 4 |
| 295 |
.nf |
| 296 |
.fam C |
| 297 |
nfsdctl listener +rdma:[f00::ba4]:20050 |
| 298 |
.fam |
| 299 |
.fi |
| 300 |
.if n .RE |
| 301 |
.sp |
| 302 |
Enable NFS version 3, disable v4.0: |
| 303 |
.sp |
| 304 |
.if n .RS 4 |
| 305 |
.nf |
| 306 |
.fam C |
| 307 |
nfsdctl version +3 \-4.0 |
| 308 |
.fam |
| 309 |
.fi |
| 310 |
.if n .RE |
| 311 |
.sp |
| 312 |
Change the number of running threads in first pool to 256: |
| 313 |
.sp |
| 314 |
.if n .RS 4 |
| 315 |
.nf |
| 316 |
.fam C |
| 317 |
nfsdctl threads 256 |
| 318 |
.fam |
| 319 |
.fi |
| 320 |
.if n .RE |
| 321 |
.sp |
| 322 |
Set the pool\-mode to "pernode": |
| 323 |
.sp |
| 324 |
.if n .RS 4 |
| 325 |
.nf |
| 326 |
.fam C |
| 327 |
nfsdctl pool\-mode pernode |
| 328 |
.fam |
| 329 |
.fi |
| 330 |
.if n .RE |
| 331 |
.SH "NOTES" |
| 332 |
.sp |
| 333 |
nfsdctl is intended to supersede rpc.nfsd(8), which controls the nfs server |
| 334 |
using the files under /proc/fs/nfsd. nfsdctl instead uses a netlink(7) |
| 335 |
interface to achieve the same goals. |
| 336 |
.sp |
| 337 |
Most of the commands that query the NFS server can be run as an unprivileged |
| 338 |
user, but configuring the server typically requires an account with elevated |
| 339 |
privileges. |
| 340 |
.SH "SEE ALSO" |
| 341 |
.sp |
| 342 |
nfs.conf(5), rpc.nfsd(8), rpc.mountd(8), exports(5), exportfs(8), rpc.rquotad(8), nfsstat(8), netconfig(5) |
| 343 |
.SH "AUTHOR" |
| 344 |
.sp |
| 345 |
Jeff Layton |