-   Linux - Newbie (
-   -   insmod vs modprobe (

python09 11-27-2008 11:59 AM

insmod vs modprobe
I am going to have my LPI 102 exam Saturday. I am confused about insmod and modprobe . I find some of threads said that modprobe execute insmod and load the required modules automatically. Is it right? And when should insmod and modprobe use files like /etc/modules.conf , /etc/modprobe.conf and the path MODPATH,MODULECONF?

newtovanilla 11-27-2008 04:15 PM

I used modprobe command to load new modules to the kernel. Have not used insmod. Linux has documentation on them, try:
> man modprobe
> man insmod

salter 11-27-2008 10:30 PM

'insmod' will only inert a module into the kernel. It has no options, no diagnostic feedback, etc. It's a simple specialized tool.

'modprobe' is much more sophisticated: it can be verbose, can move modules in and out of the kernel and has some clever option combinations for those have to deal with kernels and modules.

armanox 11-28-2008 12:28 AM

The big things in my opinion

modprobe will add modules, remove modules, and find module dependencies

insmod only adds an individual module, and does no dependency adding, so it will fail if dependencies are not already inserted.

Quakeboy02 11-28-2008 12:35 AM

I believe that the difference is that modprobe will cause a kernel module to be loaded from the installed kernel from the /lib/modules directory, whereas insmod will load any particular .ko file you point it at, whether in /lib/modules or not. insmod, combined with rmmod, is useful when working on a module; allowing you to recompile just the module and test it, without having to do a whole kernel compile, or hack at your /lib/modules files, potentially making your kernel unbootable.

newtovanilla 11-28-2008 12:44 PM

When I see some things that use "insmod" they all seem to give the full path name to the module, while modprobe just has the name of the module without the ".ko". Oh, yeah, and modprobe will complain about dependencies!

All times are GMT -5. The time now is 12:10 PM.