You are not logged in.
Pages: 1
Hi all! Its kind of a silly question but want to know how lsmod works. Man and info pages does not have enough information and so do google. When I do lsmod it shows columns, first is 'modules', 'in use' etc..
Now there are a lot of modules that show blank in 'in use' column, like example ipv6 shows not used by anything. So should I assume that its not required by system/device, as of now and that its unnecessary burdeon and should be removed? or how it works?
Any answer is most appreciated.
Last edited by kapz (2009-10-15 14:17:13)
I wonder how it would be like to use the rest 99% of my brain..:P
Registered Linux User: 487155
Offline
Do you mean the "Used by" column?
This just indicates that it is required by the other listed modules. If there is nothing listed it means that nothing is dependant on it but that isn't the same as that it isn't doing anything.
Offline
This just indicates that it is required by the other listed modules.
Not only by other modules, but also by the stuff on the system, e.g. apps using the sound device will increment the counter for the snd_xxx module. Only when the count is 0, can you unload the module.
Last edited by lucke (2009-10-14 00:17:16)
Offline
sorry I meant 'Used by' and not 'in use'.
Thanks for the answer..so there are a LOT of modules which show count as 0, so does this mean they are not required/unnecessary. In that case to remove them should I use rmmod only or after that I need to delete them manually as well?
Edit* Strange thing is both of my NIC card modules are showing count 0 in Used by column, but I am very well using it right now! *Edit
Last edited by kapz (2009-10-14 09:08:50)
I wonder how it would be like to use the rest 99% of my brain..:P
Registered Linux User: 487155
Offline
For what it's worth, lsmod does very little. It just reads /proc/modules and reformats it for you. So the real answers are found inside the kernel.
Offline
Hi ataraxia can you please explain:
the real answers are found inside the kernel.
I wonder how it would be like to use the rest 99% of my brain..:P
Registered Linux User: 487155
Offline
Unloading some modules, like filesystem's, could have drastic consequences. Others, like NIC's modules, aren't as crucial.
Offline
Hi ataraxia can you please explain:
the real answers are found inside the kernel.
I mean, that you have to read the kernel code that writes /proc/modules to know what is happening. I've never read any of this code myself.
Offline
You can get a little (usually really very little) info about a module by running 'modinfo <modulename>'.
Offline
I find it's a lot of info that modinfo prints... PCI code matches, a little info (yes ) about what the module does, and most importantly: module loading parameters. Especially the latter can be invaluable.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Ow, so the total package to understand that would be - - kernel sources,modules,lsmod,depmod,modprobe and modinfo...
all of which I cant differentiate between kernel sources and kernel module sources or kernel sources and kernel modules...!
But thanks for the pointer you all. Will mark it as closed as to understand this would require some homework..
I wonder how it would be like to use the rest 99% of my brain..:P
Registered Linux User: 487155
Offline
Pages: 1