Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-29-2004, 01:06 AM
|
#1
|
Member
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261
Rep:
|
unloading modules
Hi all
How do I unload a module that is currently busy. Basically I want to force it to unload and then restart it up again. I have fedora core 1.
thanks,
|
|
|
03-29-2004, 09:15 AM
|
#2
|
LQ Guru
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672
Rep:
|
you cant !!!
thats like trying to replace a piston in a running engine.
post your lsmod, and say which module you are trying to unload, it should be obviouse what the module is being used by.
ohh, and why do you want to unload it, then load again ? what does that gain ?
|
|
|
03-29-2004, 10:54 AM
|
#3
|
Member
Registered: Feb 2004
Posts: 467
Rep:
|
The 2.6 kernels can be compiled to support unloading modules. I don't know if the precompiled versions support it, but in any event you'll have to upgrade your kernel to use this feature
|
|
|
03-29-2004, 12:52 PM
|
#4
|
Member
Registered: Aug 2003
Location: italy
Distribution: slackware,debian,mandrake
Posts: 39
Rep:
|
Hi,
If your kernel supports unloading module, use
modprobe -r modulename
see man modprobe for details
|
|
|
03-29-2004, 03:20 PM
|
#5
|
LQ Guru
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672
Rep:
|
quote: "2.6 kernel support module unloading"
yeah, so do 2.4 kernels, but that doesnt change the fact that you cannot rip out a module that is in use.
|
|
|
03-29-2004, 03:54 PM
|
#6
|
Member
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261
Original Poster
Rep:
|
basically my sound stalled when gxine was accessed for some website. I lost my sound so without a reboot i tried to unload sound module then reload it again. But later i found out that if i start up gxine then close it my sound came back. It was a bit weird but thats what i wanted to do at least. Thanks for all the help guys.
Here is my lsmod i know soundcore is being used by cmpci both devices are busy.
Module Size Used by Not tainted
cmpci 38676 1 (autoclean)
gameport 3380 0 (autoclean) [cmpci]
soundcore 6500 4 (autoclean) [cmpci]
parport_pc 18468 1 (autoclean)
lp 8356 0 (autoclean)
parport 36800 1 (autoclean) [parport_pc lp]
autofs 12052 0 (autoclean) (unused)
natsemi 19008 1
ipt_REJECT 4216 1 (autoclean)
ipt_state 1112 3 (autoclean)
ip_conntrack 28616 1 (autoclean) [ipt_state]
iptable_filter 2444 1 (autoclean)
ip_tables 14752 3 [ipt_REJECT ipt_state iptable_filter]
floppy 56348 0 (autoclean)
sg 34796 0 (autoclean)
sr_mod 17016 0 (autoclean)
ide-scsi 11856 0
scsi_mod 109384 3 [sg sr_mod ide-scsi]
ide-cd 34176 0
cdrom 34048 0 [sr_mod ide-cd]
ohci1394 28520 0 (unused)
ieee1394 203940 0 [ohci1394]
scanner 11544 0 (unused)
keybdev 2624 0 (unused)
hid 23652 0 (unused)
ehci-hcd 19784 0 (unused)
usb-uhci 25740 0 (unused)
usbcore 77984 1 [scanner hid ehci-hcd usb-uhci]
mousedev 5204 1 (autoclean)
input 5824 0 (autoclean) [keybdev hid mousedev]
ext3 70980 2
jbd 51084 2 [ext3]
|
|
|
03-29-2004, 04:09 PM
|
#7
|
Member
Registered: Dec 2002
Distribution: Slackware
Posts: 927
Rep:
|
also try running "ps aux" to check if anything is still running and use "kill" if so.
|
|
|
03-30-2004, 03:25 PM
|
#8
|
LQ Guru
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672
Rep:
|
you need to rm all the top 3 modules at the same time...
rmmod moduleA moduleB moduleC
if a module has a module listed in USED BY, then it will not unload. unload the module thats using it first, also..
lsof /dev/dsp
will list the user level programs using the sound card. kill them too.
|
|
|
03-30-2004, 03:30 PM
|
#9
|
Member
Registered: Jan 2004
Location: London
Distribution: Debian
Posts: 33
Rep:
|
and
modprobe -r -f <modname> (if you have compiled in 'force module unloading' in 2.6 kernel)
gets really serious, although if there is a file open, you will end up in trouble. however, desperate times call for desperate measures. E.g. if you have an open file on a hard mounted nfs share without the interruptable (intr) flag set...
|
|
|
All times are GMT -5. The time now is 03:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|