 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

12th June 2008, 11:48 AM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 48

|
|
|
How to remove an "in use" module?
Hello,
I'm writing a kernel driver. After installing (/sbin/insmod) it successfully, I test it but there's a problem that I can't remove it (/sbin/rmmod). Error: Module my_module is in use.
Could you tell me how to stop it, or unload or something like that, to remove that module. Currently, I have to restart Fedora... I used "rmmod -w" but it didn't help.
Thanks in advance,
|

12th June 2008, 03:50 PM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 245

|
|
|
lsmod will tell you who is using the module. Remove the user module first.
|

12th June 2008, 05:17 PM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 48

|
|
|
Yes, I usually use lsmod. But how to remove "user module"? A module is usually shown as using by "a user ID". How can I remove it, it can be ... me?
I tried "man lsmod" and "man rmmod" but no useful option. Could you explain for me? Thanks in advance!
Last edited by lehoanq; 12th June 2008 at 05:21 PM.
|

12th June 2008, 05:29 PM
|
 |
Administrator
|
|
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289

|
|
|
I'm pretty sure that bingoUV meant: you must first remove whatever other module is using the one that you really want to remove. There must either be another module loaded that depends on the one that you're trying to unload, or, the one that you're trying to unload is being used by some other application or process. Example: DRI driver module depends on DRM module, so remove DRI module before trying to remove DRM module.
You can focibly remove a module: re-read 'man rmmod'. However, you do so entirely at your own risk.
V
|

12th June 2008, 05:48 PM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 48

|
|
Quote:
|
Originally Posted by Hlingler
I'm pretty sure that bingoUV meant: you must first remove whatever other module is using the one that you really want to remove. There must either be another module loaded that depends on the one that you're trying to unload, or, the one that you're trying to unload is being used by some other application or process. Example: DRI driver module depends on DRM module, so remove DRI module before trying to remove DRM module.
You can focibly remove a module: re-read 'man rmmod'. However, you do so entirely at your own risk.
V
|
Thank you, I got it. I'll track the 'user module' (I think it's 'owner module') to see if there's any strange module that uses my module. In the worst case, I'll have to restart OS, just like what I'm (having to) dong now
Thank all of you. Have a nice day!
|

12th June 2008, 05:59 PM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 245

|
|
Sorry, user module means the module that is using your module. Like my lsmod in outputs this format:
Code:
Module Size Used by
If your module comes in first column, the third column will tell you which module is using your module. rmmod this module of the 3rd column and then rmmod your own module.
|

12th June 2008, 06:47 PM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 48

|
|
|
As i guess, the owner of my module has changed after I wrote a value to my module. But, as you see, the "used by" - the 3rd column, they're just numbers: 0,1,2... What does it refer to? How can I know what number is what module name?
Thanks,
|

13th June 2008, 01:42 AM
|
 |
Administrator
|
|
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289

|
|
Quote:
|
Originally Posted by lehoanq
As i guess, the owner of my module has changed after I wrote a value to my module. But, as you see, the "used by" - the 3rd column, they're just numbers: 0,1,2... What does it refer to? How can I know what number is what module name?
Thanks,
|
If no other module name is listed in column #3, then there is no dependent module, and so there must be some application and/or service using the module (example: DRI module always in use by XORG):
Code:
[root@localhost Thu Jun 12 20:38:31 ~]# lsmod|grep -i nvid
nvidia 7816064 34
i2c_core 21057 3 eeprom,nvidia,i2c_nforce2
[root@localhost Thu Jun 12 20:38:39 ~]#
Not sure what that number ("34") means, but if rmmod says that the module is in use, then it's in use....
V
|

13th June 2008, 02:47 AM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 48

|
|
Quote:
|
Originally Posted by Hlingler
Not sure what that number ("34") means, but if rmmod says that the module is in use, then it's in use....
V
|
I did some searching and they said '34' means there're 34 modules using this module.
For more detail, depmod may help...
|

13th June 2008, 02:51 AM
|
 |
Administrator
|
|
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289

|
|
Quote:
|
Originally Posted by lehoanq
I did some searching and they said '34' means there're 34 modules using this module.
For more detail, depmod may help...
|
Then any number >0 indicates that the module is in fact in use by some other module(s), application(s), or process(es), somewhere.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 11:14 (Saturday, 25-05-2013)
|
|
 |
 |
 |
 |
|
|