how can i remove unused but loaded kernel modules?

Mark markg85 at gmail.com
Sat Jun 9 18:02:56 UTC 2007


i fully agree with you.
but at the moment i have nothing to be careful with because i still don`t
know how to get the gone by default.

2007/6/9, Nigel Henry <cave.dnb at tiscali.fr>:
>
> On Saturday 09 June 2007 17:57, Mark wrote:
> > Hey Eric,
> >
> > Your partly right.
> >
> > > However, they'd still have to load during bootup, then they'd get
> removed
> > > as a final step in /etc/rc.d/rc.local.  I think what Mark wanted
> (Mark,
> > > please correct me if I'm wrong) is not to load them in the first
> place,
> > > so that bootup happens faster.
> >
> > that`s what i want indeed.
> >
> > I'm far, far away from being any kind of an expert on Linux use of
> modules,
> >
> > > but isn't it true that modules only get loaded if they are
> needed?  So,
> > > if Mark goes through all the startup services (in chkconfig, or
> > > system-config-services) and disables all the ones he doesn't want or
> need
> > > (which will probably be a lot of them), won't that result in modules
> not
> > > getting loaded that are assocuated with the eliminated startup
> processes?
> >
> > That`s partly right.
> > i did remove all the services that i didn`t want  but the loaded module
> > list is still the same.
> > i even removed all the modprobe files and it`s still exactly the same.
> (rm
> > -rf /etc/modprobe*) (actually moved them to my personal folder..
> > /home/mark)
> >
> > This is the list of modules that i have:
> >
> > [root at localhost ~]# lsmod
> >
> > > Module                  Size  Used by
> > > ipv6                  276673  20
> > > i915                   25793  3
> > > drm                    78037  4 i915
> > > autofs4                24645  2
> > > nf_conntrack_ftp       13761  0
> > > nf_conntrack_netbios_ns     7105  0
> > > nf_conntrack_ipv4      15049  12
> > > xt_state                6593  12
> > > nf_conntrack           61001  4
> > > nf_conntrack_ftp,nf_conntrack_netbios_ns,nf_conntrack_ipv4,xt_state
> > > nfnetlink              10841  2 nf_conntrack_ipv4,nf_conntrack
> > > xt_tcpudp               7233  14
> > > ipt_REJECT              8641  2
> > > iptable_filter          6977  1
> > > ip_tables              16389  1 iptable_filter
> > > x_tables               18757  4
> xt_state,xt_tcpudp,ipt_REJECT,ip_tables
> > > cpufreq_ondemand       11981  1
> > > acpi_cpufreq           14281  1
> > > dm_multipath           21705  0
> > > video                  21065  0
> > > sbs                    19173  0
> > > i2c_ec                  9281  1 sbs
> > > button                 12113  0
> > > dock                   13669  0
> > > battery                14149  0
> > > ac                      9413  0
> > > lp                     15977  0
> > > parport                38025  1 lp
> > > loop                   19785  0
> > > arc4                    6209  2
> > > ecb                     7489  2
> > > blkcipher              10181  1 ecb
> > > rc80211_simple          8257  1
> > > sdhci                  21069  0
> > > serio_raw              10821  0
> > > mmc_core               30661  1 sdhci
> > > b44                    29517  0
> > > mii                     9409  1 b44
> > > iTCO_wdt               14693  0
> > > pcspkr                  7105  0
> > > iTCO_vendor_support     7877  1 iTCO_wdt
> > > iwl3945               141477  0
> > > i2c_i801               12241  0
> > > intelfb                38629  0
> > > mac80211              136005  2 rc80211_simple,iwl3945
> > > cfg80211               12105  1 mac80211
> > > i2c_algo_bit           11337  1 intelfb
> > > i2c_core               24641  4 i2c_ec,i2c_i801,intelfb,i2c_algo_bit
> > > sr_mod                 20197  0
> > > cdrom                  37217  1 sr_mod
> > > snd_hda_intel          24281  0
> > > snd_hda_codec         202689  1 snd_hda_intel
> > > snd_pcm                74565  2 snd_hda_intel,snd_hda_codec
> > > snd_timer              24773  1 snd_pcm
> > > snd                    53189  4
> > > snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
> > > soundcore              11553  1 snd
> > > snd_page_alloc         13769  2 snd_hda_intel,snd_pcm
> > > joydev                 13441  0
> > > sg                     37213  0
> > > dm_snapshot            20709  0
> > > dm_zero                 6209  0
> > > dm_mirror              24277  0
> > > dm_mod                 57229  9
> > > dm_multipath,dm_snapshot,dm_zero,dm_mirror ata_piix
> 18757
> > > 2
> > > ata_generic            12101  0
> > > libata                115417  2 ata_piix,ata_generic
> > > sd_mod                 23873  3
> > > scsi_mod              137549  4 sr_mod,sg,libata,sd_mod
> > > ext3                  125385  2
> > > jbd                    59881  1 ext3
> > > mbcache                12357  1 ext3
> > > ehci_hcd               35405  0
> > > ohci_hcd               23749  0
> > > uhci_hcd               26833  0
> > > [root at localhost ~]#
> >
> > Now all the modules that have: "Used By 0" can be thrown away because
> > nothing is using it.
> > that`s what i want. i don`t want to load the modules first and unload
> them
> > at the end of the boot progress (that doesn`t speed up the boot progress
> > but slows it down).
> >
> > please tell me that it`s possible without recompiling the kernel :) (if
> > not.. that will take serveral hours)
> >
> > any ideas?
> >
> > 2007/6/9, Eric <spamsink at scoot.netis.com>:
>
> I still say that you want to be carefull in removing modules from being
> loaded. For example the USB modules below arn't being used at the moment.
> > > ehci_hcd               35405  0
> > > ohci_hcd               23749  0
> > > uhci_hcd               26833  0
>
> Now you plug something into the USB, and it won't work, because the
> necessary
> modules arn't loaded.
>
> Again, looking at your soundcard module, as below.
> snd_hda_intel          24281  0
>
> At the moment it is using nothing, so it seems.
>
> I've just looked at my /sbin/lsmod, and my snd-ens1371 was showing a 4.
>
> I stopped the Internet radio, and this has now gone to "1". I don't know
> whats
> still using the soundcard, but it's sufficient to say that if you remove
> the
> soundcard module, and do want sounds, you will no longer have them.
>
> btw. I have just restarted Internet radio with Opera, and snd-ens1371 has
> gone
> from "1" to "4" again.
>
> Some modules may be showing a "0", but when you plugin a USB device, or
> start
> some app that uses the soundcard, this scenario may change.
>
> Personally I couldn't care less if my OS boots up in 2mins, 5mins, or 10
> mins,
> as long as it boots up.
>
> Just my 2¢ worth
>
> Nigel.
>
>
>
>
>
>
>
>
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070609/7d193b84/attachment-0001.htm>


More information about the fedora-list mailing list