Linux insmod command

Updated: 01/24/2018 by Computer Hope

About insmod

insmod is a simple program that inserts a module into the Linux kernel.


insmod is similar to modprobe: it can insert a module into the Linux kernel. Unlike modprobe, however, insmod does not read its modules from a set location and automatically insert them and take care of any dependencies. insmod can insert a single module from any location, and does not consider dependencies when doing so. It's a much lower-level program; in fact, it's the program modprobe uses to do the actual module insertion.

insmod syntax

insmod [file name] [module-options...]

Technical Description

insmod takes as its arguments the file name of a kernel module and any module-specific options, module-options, which the module takes upon insertion.

The only error messages insmod can issue are very general ones, since the actual work of linking the module is done within the kernel itself. Since any errors issued will be generated by the kernel, they are best viewed with dmesg.

insmod examples

insmod /path/to/snd-usb-audio.ko

Insert the snd-usb-audio module into the kernel, specifying no module options.

insmod /path/to/snd-usb-audio.ko snd-cmipci snd_id="first" snd_mpu_port=0x330

Insert the snd-usb-audio module into the kernel, specifying the module options "snd-cmipci", "snd_id="first"", and "snd_mpu_port=0x330".

depmod — Generate a list of kernel module dependencies and associated map files.
lsmod — Show the status of Linux kernel modules.
modinfo — Show information about a Linux kernel module.
modprobe — Add and remove modules from the Linux kernel.
rmmod — Remove a module from the Linux kernel.