LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 11-27-2008, 12:59 PM   #1
python09
LQ Newbie
 
Registered: Nov 2008
Distribution: Ubuntu, Redhat
Posts: 10

Rep: Reputation: 0
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?
thanks

Last edited by python09; 11-27-2008 at 01:00 PM.
 
Old 11-27-2008, 05:15 PM   #2
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Rep: Reputation: 30
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
 
Old 11-27-2008, 11:30 PM   #3
salter
Member
 
Registered: Oct 2008
Posts: 100

Rep: Reputation: 15
'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.

Last edited by Tinkster; 10-30-2010 at 05:05 PM.
 
Old 11-28-2008, 01:28 AM   #4
armanox
Member
 
Registered: Sep 2005
Location: Baltimore, MD, USA
Distribution: Fedora, Gentoo, Debian, Slackware, IRIX, OS X
Posts: 192

Rep: Reputation: 32
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.
 
Old 11-28-2008, 01:35 AM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
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.
 
1 members found this post helpful.
Old 11-28-2008, 01:44 PM   #6
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Rep: Reputation: 30
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL4 insmod/modprobe issues t3chn0m0nk3y Linux - Newbie 18 09-04-2008 01:42 PM
modprobe and insmod not working navin_karnam Linux - General 8 08-01-2007 12:37 AM
modprobe or insmod? GT_Onizuka Linux - Newbie 7 04-10-2004 07:03 PM
modprobe or insmod agts Linux - Newbie 2 03-14-2004 02:18 PM
insmod/modprobe Problem Compuholic Linux - General 19 12-24-2002 11:39 AM


All times are GMT -5. The time now is 05:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration