In Ubuntu Linux, hardware device drivers, virtual networking layers, and cryptographic subsystems execute as loadable kernel modules (LKMs). Many of these modules expose tuneable parameters that govern hardware buffer sizes, power management heuristics, debugging verbosity, and protocol timeouts. While persistent module configurations are defined in /etc/modprobe.d/, inspecting current runtime parameters and applying dynamic changes without rebooting or reloading the driver is achieved directly through the kernel’s virtual filesystem in /sys/module/. Understanding how sysfs parameter nodes operate allows system administrators to optimise system performance and debug hardware drivers on live Ubuntu production systems.
How Kernel Module Parameters Are Represented in sysfs
When the Linux kernel loads an external module, it registers a directory entry for that module under /sys/module/<module_name>/. If the module author defined parameters via the module_param() macro with file permissions (such as 0644 or 0444), the kernel creates a corresponding parameters/ subdirectory:
- Read-Only Parameters (0444 / 0400): These nodes reflect hardware capabilities or settings that can only be established during initial module initialisation. They can be read via standard tools but cannot be modified at runtime.
- Read-Write Parameters (0644 / 0600): These nodes expose live operational knobs. Writing a new value into the sysfs node invokes the driver’s internal setter callback, immediately updating driver behaviour in kernel memory.
- Parameters Subdirectory Missing: If a module exposes no public parameters or compiled them with zero permissions (
0000), theparameters/folder will not exist.
Auditing Loaded Modules and Available Parameters
To inspect which modules are currently active and locate their parameter trees, use standard terminal utilities in Ubuntu:
# List all active loaded kernel modules
lsmod | head -n 20
# Check whether a specific driver (e.g. the e1000e Intel network driver) exposes parameters
ls -la /sys/module/e1000e/parameters/
# Inspect parameters for the kvm virtualisation module
ls -la /sys/module/kvm/parameters/
To view parameter descriptions and default data types before making modifications, query the module metadata via modinfo:
# Inspect module descriptions and parameter signatures
modinfo -p kvm
modinfo -p e1000e
Reading Real-Time Module Parameter Values
Because sysfs files are plain text streams generated dynamically by the kernel, standard shell utilities can read their current values:
# Read the nested virtualisation status in KVM
cat /sys/module/kvm_intel/parameters/nested
# Read all parameter values for a network driver in a single sweep
for param in /sys/module/iwlwifi/parameters/*; do
echo -n "$(basename "$param"): "
cat "$param" 2>/dev/null || echo "[unreadable]"
done
Modifying Dynamic Module Parameters at Runtime
If a parameter node possesses write permissions (-rw-r--r--), an administrator with root privileges can write new integer, boolean, or string values directly into the node using tee:
# Example: Enable or disable nested virtualisation dynamically
echo "Y" | sudo tee /sys/module/kvm_intel/parameters/nested
# Example: Adjust power saving timeout on an Intel audio driver (in seconds)
echo "10" | sudo tee /sys/module/snd_hda_intel/parameters/power_save
# Verify that the kernel accepted the updated value
cat /sys/module/snd_hda_intel/parameters/power_save
If a parameter is read-only, attempting to write to the node will result in a Permission denied or Operation not permitted error from the VFS layer.
Persisting Parameter Values Across Reboots via modprobe.d
Changes made directly to /sys/module/ nodes exist only in volatile kernel memory and revert upon reboot or module reload. To ensure custom parameters apply automatically every time Ubuntu boots, define persistent options in /etc/modprobe.d/:
# Create a custom modprobe configuration file
sudo nano /etc/modprobe.d/custom-kernel-tuning.conf
Add the desired module name followed by the parameter assignments:
# Persist KVM nested virtualisation and audio power saving
options kvm_intel nested=1
options snd_hda_intel power_save=10 power_save_controller=Y
For modules that load early during the initial RAM disk phase (such as storage controllers, root RAID drivers, or graphics drivers), regenerate the initramfs to embed the updated modprobe rules:
# Update the initramfs across all installed Ubuntu kernels
sudo update-initramfs -u
Inspecting Driver Status and Kernel Messages
Whenever a dynamic parameter is modified, monitor the kernel ring buffer using dmesg to verify that the driver accepted the input without validation errors:
# Monitor kernel messages for driver confirmations or warnings
sudo dmesg -T | tail -n 25
If the driver encounters an invalid value, it logs an explicit diagnostic message indicating whether the value was rejected or clamped to hardware limits.