The Monolithic vs. Modular Kernel
Unlike early operating systems where every single hardware driver had to be permanently compiled directly into the core kernel (creating a massive, monolithic file), modern Linux uses a modular approach. The core kernel is kept incredibly small and efficient, and external drivers—such as those for specific Wi-Fi cards, advanced filesystem support (like ZFS), or obscure USB peripherals—are compiled as standalone “modules” (usually .ko files).
When the Linux kernel detects a new piece of hardware, it dynamically loads the appropriate module into RAM. If a system administrator is attempting to troubleshoot a malfunctioning network card, or attempting to force the system to load a proprietary Nvidia graphics driver, they must manually interact with these kernel modules using the modprobe command.
Viewing Loaded Modules
Before you begin inserting new drivers, you should check what the kernel is currently utilizing. The fastest way to view all currently active modules is to use the lsmod command (List Modules).
lsmod
This command simply reads the contents of the virtual /proc/modules file and formats it into a table. The output will show the name of the module, its size in memory, and a “Used by” column, which indicates if other modules are dependent on it.
Loading a Module with modprobe
If you have installed a new piece of hardware, but the system isn’t recognizing it, the required driver module might not be loaded. To manually inject a module into the running kernel, use the modprobe command. Because you are altering the core operating system, you must use sudo.
For example, if you need to load the standard bluetooth driver module (btusb), run:
sudo modprobe btusb
Why modprobe is Better Than insmod
Linux technically has a lower-level command called insmod (Insert Module). However, insmod is considered dangerous because it is “dumb”—it attempts to load exactly the file you specify, even if that file relies on three other modules that haven’t been loaded yet, causing a kernel panic.
The modprobe command is highly intelligent. Before loading btusb, it checks the modules.dep dependency database. If btusb requires the bluetooth core module to function, modprobe will automatically load the core module first, preventing crashes.
Removing a Module
If a specific driver is causing your system to crash, or if you need to unload a generic driver so you can install a proprietary vendor driver, you can pull the module out of the active kernel.
Use the -r (remove) flag with modprobe:
sudo modprobe -r btusb
If the module is currently being used by an active hardware device or another dependent module, the command will fail and display a “Module is in use” error, protecting the system from instability.