Home / Alt manpages / proc_driver(5)

  • proc_driver(5)
  • File format
  • linux

Inspect /proc/driver Safely When the Directory Is Empty

You will learn what /proc/driver/ represents, check whether this host exposes any driver-specific entries, and read those entries without changing kernel state. Allow about ten minutes. You need a shell and a mounted proc filesystem. The examples are read-only and normally need no elevated privileges.

The short version is that an empty directory is not an error. The installed proc_driver(5) page describes /proc/driver/ as an empty subdirectory, while the broader proc documentation allows kernel components to expose driver information there. Its contents are therefore host- and kernel-dependent.

1. Check the installed documentation and kernel

Start by recording the local man-pages package and kernel. This matters because procfs is supplied by the running kernel, whereas the man page is a separate documentation package.

$ dpkg-query -W -f='${Package} ${Version}\n' manpages
manpages 6.7-2
$ man -P cat 5 proc_driver | sed -n '1,35p'
$ uname -srvm
Linux 6.8.0-139-generic #139-Ubuntu SMP PREEMPT_DYNAMIC x86_64

Your package and kernel versions will differ. In this environment the page is from Linux man-pages 6.7, dated 15 August 2023, and its NAME and DESCRIPTION identify the path as an empty directory. That is a description of the interface documented by this man page, not a guarantee that every running kernel will enumerate no entries at all.

Checkpoint: keep the kernel version separate from the man-pages version. Updating one does not automatically update the other.

2. Confirm that procfs is mounted

Use findmnt to see which filesystem supplies the path. It should normally report a proc filesystem mounted at /proc.

$ findmnt -T /proc/driver -o TARGET,SOURCE,FSTYPE,OPTIONS
TARGET SOURCE FSTYPE OPTIONS
/proc  proc   proc   rw,relatime

If the command says that /proc/driver does not exist, do not create a normal directory there as a workaround. Check findmnt -T /proc and ask whoever manages the host whether procfs is intentionally absent or restricted. Mounting procfs is an administrator action and can affect a container or service's view of the kernel; it is outside this read-only check.

Checkpoint: proceed only when /proc/driver resolves inside procfs. A directory with the same spelling on another filesystem is not the interface described by proc_driver(5).

3. List entries without following assumptions

List the directory and then inspect its immediate children. The first command shows permissions and ownership; the second reports whether a child is a regular file, directory or another procfs object.

$ ls -la /proc/driver
total 0
dr-xr-xr-x  2 root root 0 Sep 26 11:39 .
dr-xr-xr-x 14 root root 0 Sep 26 11:39 ..
dr-xr-xr-x  2 root root 0 Sep 26 11:39 rtc
$ find /proc/driver -maxdepth 1 -mindepth 1 -printf '%y %p\n' | sort
d /proc/driver/rtc

On a different machine, the listing may contain nothing. That is a valid result and matches the local man page's concise description. On this host, the kernel exposes an rtc entry. The Linux kernel proc documentation describes the directory as a place for various driver information and lists rtc as a current example. Do not infer that every driver has an entry here, or that an entry has the same fields across kernels.

4. Read a reported entry

Only read paths that the listing actually returned. For the rtc example, cat displays the kernel's current text representation:

$ cat /proc/driver/rtc
rtc_time  : 11:39:55
rtc_date  : 2026-09-26
alrm_time  : 07:49:03
alarm_IRQ  : no
periodic IRQ frequency: 1024
batt_status: okay

Output is time-sensitive and the exact spacing and field set are kernel-dependent. The excerpt shows the shape of the installed host's output, not a portable parsing contract. If you need a particular value in a script, first confirm that the entry and field exist on every supported kernel, then handle missing or changing lines as normal conditions.

A read can also fail after a successful directory listing if a driver unloads or the proc entry disappears. Treat that as a transient state change, not as permission to retry with sudo.

5. Keep driver information in the right interface

/proc/driver/ is not a catalogue of all loaded drivers. For device relationships and driver bindings, inspect sysfs instead. For loaded kernel modules, use the module tools or inspect /proc/modules. For logs about probe failures, use the system's journal or kernel log policy. These interfaces answer different questions.

$ find /sys/bus -path '*/drivers/*' -maxdepth 4 -type d 2>/dev/null | head
$ sed -n '1,5p' /proc/modules
$ findmnt -T /sys -o TARGET,SOURCE,FSTYPE,OPTIONS

The sysfs command may produce a host-specific list, and the module file may be empty or restricted in a hardened environment. Neither outcome changes the meaning of /proc/driver/. Avoid treating a missing proc entry as proof that a driver is absent.

6. Avoid writes and unsafe automation

Most procfs entries are read-only, but procfs also contains writable interfaces. The directory's permissions are not a complete safety guarantee, and running a command as root can turn an accidental write into a kernel or device configuration change.

Do not redirect output into a path under /proc/driver, use tee there, or try to create a missing entry:

$ # Safe: copy a snapshot to a normal, new file if you need one
$ umask 077
$ cat /proc/driver/rtc > /tmp/rtc-snapshot.txt
$ test -s /tmp/rtc-snapshot.txt && echo 'snapshot captured'
snapshot captured

The snapshot is disposable and does not alter the driver. Remove it later with rm -- /tmp/rtc-snapshot.txt only after checking that it contains no information you need; deletion cannot be undone. If you need a persistent record, choose a controlled location and follow its retention policy.

7. Diagnose an unexpected empty result

Work through these checks in order:

  1. Run findmnt -T /proc/driver and confirm that procfs supplies the path.
  2. Run ls -la /proc/driver again; procfs contents can change while drivers initialise or unload.
  3. Check the running kernel with uname -r, not only the man-pages package version.
  4. Use sysfs or the kernel log for driver binding and probe questions.
  5. Ask the platform administrator about container restrictions before changing mounts or privileges.

Do not create a directory, reload a module, remount procfs or reboot merely because the listing is empty. Those actions change system state and do not make a driver-specific proc entry appear unless the kernel component is designed to provide one.

Done means

  • You recorded the installed man-pages and running kernel versions.
  • You confirmed that /proc/driver is supplied by procfs.
  • You accepted an empty listing as a valid host-specific result.
  • You read only entries that actually exist and treated their format as kernel-dependent.
  • You used sysfs, module information or logs for questions that procfs does not answer.
  • You made no writes, mounts, module changes or service-disrupting changes.