Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Are there any differences between insmod and modprobe?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

Per man insmod:

Most users will want to use modprobe instead, which is more clever and can handle module dependencies.

share|improve this answer
    
ah sorry, missed that line. –  NES Jan 4 '11 at 20:52

modprobe reads the modules from /lib/modules/$(uname -r)/modules.dep.bin (or without the .bin suffix if the other file is not available). From the same file, dependencies are loaded.

modprobe accepts the name of a .ko file in /lib/modules/$(uname -r) (e.g. nvidia-current for the file dkms/nvidia-current.ko) and aliases (modules.alias.bin). Builtins (modules.alias.bin) are recognized as well, but since these modules are loaded by default, there is not point in modprobing this kind of modules.

insmod on the other hand accepts paths to files. The module does not have to reside in /lib/modules/$(uname -r), but dependencies are not automatically loaded. This is the lower program used by modprobe to load modules.

Other programs related to modules are rmmod and modinfo.

rmmod removes a kernel name based on the name from /proc/modules. This name does not necessarily have to be the same as the one passed to modprobe (for the nvidia-current file, this is nvidia for example).

modinfo accepts a filename, or the filename without .ko suffix in /lib/modules/$(uname -r).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.