LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 09-08-2009, 08:06 PM   #1
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Rep: Reputation: 16
Help on lsmod, modprobe, etc.


Hi, I just want to ask if you know any good links that will completely explain the relationships of these commands ( lsmod, lspci, modprobe ) to each other, when & where to use them. I'm trying to understand whats their purpose, I often see them when I'm installing device drivers, but I never really got the chance of understanding the whole concept behind those commands. Right now I've been scanning thru tldp.org but can't seem to find anything related. Can somebody give me some links on this? Thank you very much.
 
Old 09-08-2009, 08:35 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Hi,

The insmod,rmmod commands are being superceded by modprobe, lspci is not related to modules. The man pages for these commands are fairly straight forward -

insmod - simple program to insert a module into the Linux Kernel
rmmod - simple program to remove a module from the Linux Kernel
lsmod - program to show the status of modules in the Linux Kernel

modprobe - program to add and remove modules from the Linux Kernel

lspci - list all PCI devices

cheers,

kbp
 
Old 09-08-2009, 08:41 PM   #3
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
thank you for the quick summary! currently also reading this link http://www.faqs.org/docs/kernel/
 
Old 09-08-2009, 08:53 PM   #4
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
lsmod = list modules
... a module is like a driver in windows, and is often called that where the module's job is to get some hardware working.

the command returns a list of all the modules that are loaded by the kernel.


lspci = list PCI - where PCI is "Peripheral Component Interconnect".
... the pci interface is how almost all of your hardware is connected, so it is useful for finding out what is installed. Each PCI device (called a "card" as in "sound card", "graphics card" etc) has a ROM built into it which stores a description of what it is. The lspci command returns a list of the contents of the roms.

modprobe = module probe - this is a utility for managing modules. It's job is to ake sure that modules are loaded and unloaded correctly.


The commands are used in basic HW troubleshooting.

lspci is used to identify troublesome hardware by chipset - what the vendor puts on the spec list is seldom useful.

When the chipset is identified, we can find out which module (driver) is needed. Often, the driver is already in the kernel, so many HW devices work out of the box. We use lsmod to check if the kernel is loading the driver.

If it is, there there is another problem. If not, then we try to load the driver manually with modprobe.
 
Old 09-08-2009, 09:01 PM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,281
Blog Entries: 3

Rep: Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446
Hi,

Just a few links to aid you;

Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Linux Newbie Admin Guide
LinuxSelfHelp
Getting Started with Linux

These links and others can be found at 'Slackware-Links' . More than just SlackwareŽ links!
 
Old 09-08-2009, 09:11 PM   #6
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
thank you very much for the additional explanation. the lspci part really helped a lot. so the lspci can somehow communicate to the "cards" and get some info from them even though you don't have yet the proper drivers for them? can i say lspci is the first step in configuring a hardware on linux? like get first the chipset of the device that you think is not working, then check for the proper module to load for it. thanks again.
 
Old 09-08-2009, 09:25 PM   #7
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
@onebuck - thanks guy for the links. very much appreciated.


although i just want to note also that some of the problems i saw on some linux tutorials is that they lack what i call "concepts", there are a lot of good tutorials out there, and there are also some that goes straight up to commands, problem is with newbies like me getting lost on the purpose of each command they give. like whats the idea behind it, why on that sequence, whats the relation of each command to each other. i just don't wanna learn that way, i don't want to just memorize every command, i wanna know the concept behind that command. i hope i've explained it well. thanks again.
 
Old 09-08-2009, 09:25 PM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,281
Blog Entries: 3

Rep: Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446
Hi,

You can 'man command';

Quote:
lspci - list all PCI devices
SYNOPSIS
lspci [options]
DESCRIPTION
lspci is a utility for displaying information about all PCI buses in the system and all devices connected to them.

If you are going to report bugs in PCI device drivers or in lspci itself, please include output of "lspci -vvx".
You can use 'lspci' along with other system gathering commands to diagnose or even get information too allow one too setup of your system.
 
Old 09-08-2009, 09:32 PM   #9
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
@onebuck - thank you very much again!

very nice forum, quick replies =)
 
Old 09-08-2009, 09:39 PM   #10
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
I have found this page handy....

Linux Command Reference Index
http://www.perpetualpc.net/srtd_commands_rev.html
 
Old 09-08-2009, 11:26 PM   #11
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by mortonmorton View Post
thank you very much for the additional explanation. the lspci part really helped a lot. so the lspci can somehow communicate to the "cards" and get some info from them even though you don't have yet the proper drivers for them?
Of course - how else can the computer know what drivers to use?

The computer can already access memory chips. The card has a memory chip on it with the information it needs. The usefulness of the information varies though. For more on the PCI bus standard, see this:

http://www.ibm.com/developerworks/library/pa-spec5.html
 
Old 09-09-2009, 12:43 PM   #12
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
@Simon - thank you very much for the article, it's all much clearer now =)
 
Old 09-09-2009, 09:24 PM   #13
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
No worries.

Since you are the type to be interested in this sort of thing, it is probably a good idea to get used to reading the documentation. Things like what you asked is the sort of thing you pick up over time, since not all that info is readily available in one place. But all of it comes from reading the man pages, and reading around the information they contain.

It's daunting at first, but you soon get used to it.
 
  


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
Error message: modprobe: modprobe: can't locate module nls_iso8859-1 berty800 Linux - Hardware 1 06-06-2008 09:07 AM
modprobe doesn't work; why is modprobe.conf deprecated in slack 12? aquilolumen Slackware 13 08-26-2007 02:05 AM
lsmod and modprobe commands rock9604 Linux - Newbie 10 05-02-2004 11:35 PM
Can't Use lsmod/modprobe... lramos85 Linux - Newbie 2 03-08-2004 08:41 PM
modprobe: modprobe can't locate module ppp0 in redhat 7.1 while shutting down. cyberdude3k Linux - Networking 1 09-08-2003 12:01 PM


All times are GMT -5. The time now is 02:18 AM.

Main Menu
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