How to Load and Unload Kernel Modules

The Linux kernel is the foundation for a multitude of mobile, desktop, and server operating systems, from Android to Red Hat Enterprise Linux. Hardware drivers and other key components can either be built directly into the kernel and reside as modules that you can plug in or remove whenever necessary. What follows is a brief guide to loading and unload kernel modules.

As an example, we will suppose that you just installed a new driver for your PCI Express flash cache card on your server. The driver has installed its own kernel module into a directory in your kernel module path (/lib/modules/3.x.x-xx), but you may still need to load the module manually, rather than rebooting the server and giving your customers down-time.

To load the module, called flashcache_pcie, simply type this command as root:

modprobe flashcache_pcie

Under normal circumstances, it will load just fine and not provide any output. If you need to see the output, use the “-v” option:

modprobe -v flashcache_pcie

To remove that same module, type:

rmmod -v flashcache_pcie

Finally, if you want to see which modules are currently installed, type:


Once you have your module installed, your driver should work correctly without any rebooting required.