Linux Commands - insmod (insert a module)

by
Jeremy Canfield |
Updated: March 09 2020
| Linux Commands articles
The insmod command can be used to insert a module into the kernel. The file for a certain module will be somewhere below the /lib/modules directory. The lsmod command can be used to list the modules that are currently loaded into the kernel. In this example, the bcma module is not currently loaded into the kernel.
[john.doe@server1 ~]# lsmod | sort
arc4 12608 0
ata_generic 12910 0
ata_piix 35038 0
auth_rpcgss 59314 1 nfsd
. . .
The modinfo command shows that the filename for the bcma module is /lib/modules/3.10.0-327.36.3.el7.x86_64/kernel/drivers/bcma/bcma.ko.
[john.doe@server1 ~]# modinfo -n bcma
filename: /lib/modules/3.10.0-327.36.3.el7.x86_64/kernel/drivers/bcma/bcma.ko
The insmod command can be used to load the insert the acpi module into the kernel.
[john.doe@server1 ~]# insmod /lib/modules/3.10.0-327.36.3.el7.x86_64/kernel/drivers/bcma/bcma.ko
The lsmod command now shows that the bcma module is loaded into the kernel.
[john.doe@server1 ~]# lsmod | sort
arc4 12608 0
ata_generic 12910 0
ata_piix 35038 0
auth_rpcgss 59314 1 nfsd
bcma 51886 0
bluetooth 372944 5 bnep
. . .
Did you find this article helpful?
If so, consider buying me a coffee over at