Linux insmod command

Updated: 05/04/2019 by Computer Hope
insmod command

The insmod command inserts a module into the Linux kernel. It's one way of adding functionality to the core of your Linux operating system.

Description

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, automatically insert them, and manage 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.

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.

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.