[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: removing modules



On 2021-07-03 at 12:06, mick crane wrote:

> hello,
> If I type "lsmod" there is a big list of modules with many followed by a 
> "0"
> which I guess means they are not needed in the kernel ?

That depends what you mean by "needed".

As I understand matters, what that number being nonzero means is that
there's something else the kernel knows about (usually another module)
which won't work if this module isn't loaded. In order to unload this
module, you'll want to unload the other one first.

If the module is zero, that means that the kernel doesn't know of
anything other than that module which won't work unless the module is
present.

That doesn't mean that the module itself isn't needed, however. There
might be some functionality which you need which is provided directly by
that module, rather than by something which the kernel knows about and
considers to be "something else", but which won't work if the module
isn't loaded.

For example, if the driver for your network card is contained in a
module, then even if no other modules depend on that one, unloading the
module would mean your network card would stop functioning. If you need
your network to be functioning, that would mean that you still need the
module, even though there aren't any other modules (etc.) which depends
on it.

> Does lsmod know about all installed software and if a module is
> needed or does software have to be run first ?

As Reco suggested, you'll have to clarify this. Most of the time,
software does not require loading modules; it's most often hardware that
requires that.

> If I don't need them can somebody remind me how I can remove modules
> ?

The command to run is 'modprobe -r MODULE_NAME'.

You can also do it with 'rmmod MODULE_NAME', but that's not usually the
best way; IIRC, modprobe includes smarts which rmmod doesn't.

Both of those commands need to be run as root in order to work.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: