LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 03-29-2004, 01:06 AM   #1
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
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,
 
Old 03-29-2004, 09:15 AM   #2
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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 ?
 
Old 03-29-2004, 10:54 AM   #3
comp12345
Member
 
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
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
 
Old 03-29-2004, 12:52 PM   #4
redsea
Member
 
Registered: Aug 2003
Location: italy
Distribution: slackware,debian,mandrake
Posts: 39

Rep: Reputation: 15
Hi,

If your kernel supports unloading module, use

modprobe -r modulename

see man modprobe for details
 
Old 03-29-2004, 03:20 PM   #5
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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.
 
Old 03-29-2004, 03:54 PM   #6
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
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]
 
Old 03-29-2004, 04:09 PM   #7
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
also try running "ps aux" to check if anything is still running and use "kill" if so.
 
Old 03-30-2004, 03:25 PM   #8
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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.
 
Old 03-30-2004, 03:30 PM   #9
waster
Member
 
Registered: Jan 2004
Location: London
Distribution: Debian
Posts: 33

Rep: Reputation: 15
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...
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
module loading and unloading NeoUz Linux - Newbie 1 03-26-2005 03:52 AM
module unloading riseringseeker Mandriva 2 01-08-2005 03:41 PM
Automatically unloading modules? Levitate Linux - Newbie 5 10-21-2004 04:32 AM
forcefully unloading kernel module saajii Programming 2 09-29-2004 02:04 AM
Unloading Module i810.o suriyamohan Linux - Software 3 05-30-2003 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:45 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration