What it does
insmod FILE loads exactly that .ko file; it does not load dependencies or read /etc/modprobe.d. rmmod NAME removes a module that has no users. In daily work use modprobe and modprobe -r instead; insmod is for testing your own or special modules.
How to write it
insmod FILE [PARAMETER=VALUE]...
rmmod [-f] [-s] [-v] MODULE...Options 7
Most used
rmmod
Nothing matches this filter.
Examples 10
$ run as a normal user# run as root (or with sudo)
1Load a file
insmod /lib/modules/$(uname -r)/kernel/fs/fat/fat.ko.xzDependencies must be loaded first by hand.
2Error because of a missing dependency
insmod /lib/modules/$(uname -r)/kernel/fs/fat/vfat.ko.xz insmod: ERROR: could not insert module …: Unknown symbol in modulemodprobe vfat would load fat automatically.
3Remove a module
rmmod vfatMust not be in use.
4Module in use
rmmod xfs rmmod: ERROR: Module xfs is in useUnmount the file systems first.
5With parameters
insmod ./mydriver.ko debug=1Testing your own driver.
6Find the file of a module
modinfo -n vfatThen insmod that file.
7Prefer modprobe
Handles dependencies and config.
8Check signature enforcement (Secure Boot)
mokutil --sb-stateWith Secure Boot, unsigned modules are refused.
9Log of module loading
journalctl -k | grep -i moduleLoad and taint messages.
10Check the kernel taint state
cat /proc/sys/kernel/tainted 0Not 0 = an unsigned, out-of-tree or forced module was loaded.
Nothing matches this filter.
Exit codes
0 :: Done. 1 :: Error.