LinuxQuestions.org
Visit Jeremy's Blog.
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, 11:59 AM   #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 12:00 PM.
 
Old 11-27-2008, 04: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, 10: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 04:05 PM.
 
Old 11-28-2008, 12: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, 12:35 AM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,391

Rep: Reputation: 141Reputation: 141
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, 12: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 12:42 PM
modprobe and insmod not working navin_karnam Linux - General 8 07-31-2007 11:37 PM
modprobe or insmod? GT_Onizuka Linux - Newbie 7 04-10-2004 06:03 PM
modprobe or insmod agts Linux - Newbie 2 03-14-2004 01:18 PM
insmod/modprobe Problem Compuholic Linux - General 19 12-24-2002 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:43 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
Open Source Consulting | Domain Registration