Candid photograph of a Linux server terminal with a soft olive-green glow against a dark slate background, conveying a calm technical atmosphere.

Step-by-step guides for system administrators — covering command-line basics, web server setup, and preparation material for technical interviews.

Browse Tutorials

Managing Kernel Modules With modprobe and lsmod on Fedora

Kernel modules are pieces of code that extend the Linux kernel while the system is running. Drivers for network adapters, storage controllers, filesystems, USB devices, and virtualisation features are commonly delivered as modules rather than compiled permanently into the kernel.

On Fedora, lsmod shows modules currently loaded into memory, while modprobe loads or removes modules and resolves their dependencies. Together, these commands provide a practical way to inspect hardware support and control kernel features without rebooting.

This approach suits administrators maintaining Fedora workstations in Melbourne, Sydney, or Brisbane, as well as servers hosted in Australian cloud regions. It is useful for testing a driver, resolving a hardware fault, or preparing a controlled configuration change during an AEST or AEDT maintenance window.

Kernel changes should still be treated carefully. A faulty storage or network module can interrupt access, and systems handling personal information may need change records aligned with the Privacy Act 1988 and internal security controls.

What Kernel Modules Do

A module is usually stored as a compressed .ko file under /lib/modules/$(uname -r)/. Fedora may load it automatically when hardware is detected, when a service requests a capability, or when the module is listed in the initial RAM filesystem.

Dependencies matter because one module can rely on several others. For example, a filesystem driver may require common block-device support. modprobe reads dependency information and loads the required supporting modules, making it safer than inserting a single file manually with insmod.

To confirm the running kernel and module directory, use:

uname -r
find /lib/modules/$(uname -r) -type f -name '*.ko*' | head

Inspect Loaded Modules

Run lsmod to display the module name, memory size, and number of active users:

lsmod

The output is easier to search when investigating a particular driver:

lsmod | grep -E 'kvm|nf_|virtio'

For deeper information, use modinfo. It can reveal the module filename, author, licence, parameters, aliases, and dependencies:

modinfo virtio_net
modinfo -F filename virtio_net

A module shown in lsmod is active in the current session, but its presence does not prove that every related device is working. Check hardware detection with lspci -k, lsusb -t, or journalctl -k.

Load And Remove Safely

Load a module with modprobe:

sudo modprobe dummy
lsmod | grep '^dummy'

The command normally produces no output when successful, so verify the result with lsmod or inspect the kernel message buffer. To remove it, use:

sudo modprobe -r dummy

Removal fails if a process or another module is using the target. Do not force removal on a production host simply to make the command succeed. A network driver, storage driver, or filesystem module may be essential to the current session.

When diagnosing a failed load, useful checks include:

sudo modprobe -v module_name
sudo dmesg | tail -30

The -v option displays the actions performed by modprobe, while kernel messages often identify missing firmware, unsupported hardware, or an invalid parameter.

Make Module Settings Persistent

A module loaded manually usually disappears after reboot. To load it during startup, create a configuration file in /etc/modules-load.d/:

sudo tee /etc/modules-load.d/example.conf <<'EOF'
dummy
EOF

Options belong in /etc/modprobe.d/, where each line associates parameters with a module:

sudo tee /etc/modprobe.d/example.conf <<'EOF'
options bonding mode=active-backup miimon=100
EOF

Use modinfo -p module_name to see supported parameters before changing them. After modifying module settings needed during early boot, rebuild the initramfs where appropriate:

sudo dracut --force

Keep configuration files specific and documented. On a Fedora server in an Australian cloud region, recording the reason for a setting helps another administrator distinguish an intentional driver option from an obsolete workaround.

Troubleshoot With Logs

A module may appear to load successfully while the device still reports errors. Review recent kernel events with:

sudo journalctl -k -b
sudo journalctl -k -p warning..alert

For a wider systemd view, the systemd log analysis workflow can connect module events with services, mounts, and network startup failures.

Compare the current boot with an earlier one when the problem is intermittent:

sudo journalctl -k -b -1
sudo journalctl -u NetworkManager --since today

A missing firmware message, repeated device reset, or “unknown symbol” error gives a more useful direction than repeatedly unloading and reloading the same module. Save relevant logs before rebooting, especially when working over an NBN-connected remote link.

Apply Changes In Production

Test module changes on a matching Fedora system before applying them to a fleet. A kernel update can change module paths, supported parameters, or dependency behaviour, so validate after every significant update.

Schedule disruptive work outside busy periods, such as the start of the Sydney business day, and use console access for changes that could disable networking. Keep a second administrative route available where possible.

Security teams should also separate kernel diagnostics from ordinary user activity. A workstation browsing entertainment pages, including online roulette tables, should not be treated as evidence that a kernel module is safe or trustworthy; module provenance and package signatures remain the relevant controls.

Operational Checks For Administrators

Use a short checklist before and after changing a module. This is especially useful in regulated environments where system changes and access events must be auditable.

What To Remember

lsmod is the inspection tool: it shows what is currently resident and which modules depend on it. modprobe is the management tool: it loads modules, resolves dependencies, applies options, and removes unused modules more safely than direct insertion commands.

For reliable Fedora administration, inspect first, change one variable at a time, read the kernel journal, and plan a recovery path before touching critical drivers. The essential point to remember is that kernel modules are live system components, so every load, removal, and persistent option should be treated as a controlled operational change.