Check the Linux Sun RPC sysctl Directory Before Touching NFS
You will finish with a safe, repeatable check for the Linux Sun RPC sysctl directory used by NFS-related kernel support. The check tells you whether /proc/sys/sunrpc/ exists, what entries this host exposes, and whether a missing directory is simply a host-specific condition. It does not change a kernel setting or restart an NFS service.
The route
Jump straight to the step you need, or tick off Done means at the end.
Allow about ten minutes. You need a shell and a mounted /proc filesystem. The examples were checked against the installed manpages package version 6.7-2 and Linux 6.8.0-139-generic. Your kernel, distribution and loaded modules can expose a different result.
This guide is deliberately conservative. The installed proc_sys_sunrpc(5) page documents the directory and its purpose, but does not promise particular files or values. Do not turn an old list of Sun RPC tunables into a configuration recipe for a newer host without checking the running kernel and the relevant subsystem documentation.
1. Confirm the local documentation and kernel
Start with ordinary, read-only commands. No elevated privileges are needed:
$ man 5 proc_sys_sunrpc
$ dpkg-query -W -f='${Package} ${Version}\n' manpages
manpages 6.7-2
$ uname -sr
Linux 6.8.0-139-generic
The package version identifies the manpage you are using, not every kernel component involved in NFS. uname identifies the running kernel. Record both when reporting a host-specific result.
Checkpoint: if man 5 proc_sys_sunrpc fails, install or consult the documentation package through your normal operating-system process before making changes. Do not compensate by copying a random sysctl list from another distribution.
2. Check whether the directory exists
Test the exact path and print a useful status:
if [ -d /proc/sys/sunrpc ]; then
printf '%s\n' '/proc/sys/sunrpc exists'
else
printf '%s\n' '/proc/sys/sunrpc is not present'
fi
The manpage explicitly allows the directory to be absent on some systems. A missing directory is therefore a result to investigate, not proof that NFS is broken and not permission to create the directory yourself. /proc is a kernel-provided pseudo-filesystem; making an ordinary directory with the same name would not provide the kernel interface described by the manpage.
On the machine used for this guide, the directory is not present. That is the expected output from the check above on this host, but it is not a universal default.
3. List only what this host exposes
If the directory exists, list its immediate entries without following guesses about their names:
if [ -d /proc/sys/sunrpc ]; then
find /proc/sys/sunrpc -mindepth 1 -maxdepth 1 -printf '%f\n' | sort
fi
This command reads directory metadata and sorts the names. It does not write values, load a module or contact an NFS server. An empty listing is possible and still worth recording. An entry name alone also does not tell you its accepted values, default, persistence rules or effect on a live workload.
For a quick human-readable inspection, use:
$ ls -la /proc/sys/sunrpc
total 0
dr-xr-xr-x 1 root root 0 Sep 26 00:00 .
dr-xr-xr-x 1 root root 0 Sep 26 00:00 ..
The timestamps and ownership can vary. If the path is absent, ls will instead report an error such as No such file or directory; treat that as the result from step 2, not as a reason to create the path.
4. Use sysctl as a read-only cross-check
If sysctl is installed, ask it to show the Sun RPC namespace without changing anything:
$ sysctl -a 2>/dev/null | grep '^sunrpc\.'
$ printf 'sysctl status: %s\n' "$?"
sysctl status: 1
Status 1 here means that this pipeline found no matching output. It does not distinguish an absent directory from a namespace with no matching entries, and the final status also depends on the filtering command. Use the direct directory test as the authoritative check for the path.
If you need to preserve the reason for a failed sysctl invocation, run the command without hiding its diagnostic:
$ sysctl -a | grep '^sunrpc\.'
sysctl: ...
The exact diagnostic is host-specific. Do not treat a permission error, an unavailable command or no matching names as equivalent conditions.
5. Do not write a value until you have a current contract
Writing under /proc/sys is a privileged, live kernel configuration change. It can alter RPC or NFS behaviour for processes on the host, and an incorrect value can disrupt a workload. Stop before any command using sysctl -w or shell redirection such as sudo sh -c 'echo VALUE > /proc/sys/sunrpc/NAME'.
The local proc_sys_sunrpc(5) page does not document a NAME, a VALUE, a default or a rollback command. Consequently, this guide gives no write example. Before making a change, identify the exact file on the running kernel, read its authoritative documentation or source, capture its current value, and establish a service-specific maintenance and recovery plan. If the setting is meant to persist, separately verify which configuration mechanism your distribution supports; a one-off write and a persistent boot policy are different changes.
If you have already changed a documented setting and need to undo it, restore the value you recorded before the change, using the same documented interface. If you did not record the old value, do not guess a default. Stop the affected service or follow its vendor recovery procedure while you establish the correct value.
6. Report the result without overclaiming
A useful report includes the kernel release, manpages version, exact path result and the names actually listed. For example:
printf 'kernel: '; uname -sr
printf 'manpages: '; dpkg-query -W -f='${Version}\n' manpages 2>/dev/null || printf '%s\n' 'not queried'
if [ -d /proc/sys/sunrpc ]; then
printf '%s\n' 'sunrpc directory: present'
find /proc/sys/sunrpc -mindepth 1 -maxdepth 1 -printf '%f\n' | sort
else
printf '%s\n' 'sunrpc directory: absent'
fi
Say "this host does not expose /proc/sys/sunrpc" rather than "Linux does not support Sun RPC". The manpage only establishes the directory's NFS-related purpose and warns that it may not exist on some systems. It does not define a universal inventory of settings.
Done means
- You checked the running kernel and local
proc_sys_sunrpc(5)version. - You tested
/proc/sys/sunrpcdirectly and recorded whether it exists. - You listed only entries exposed by this host instead of assuming names from another kernel.
- You kept the inspection read-only and did not create a substitute directory.
- You have a documented current value and recovery plan before any privileged write or service change.