Fedora Linux Support Community & Resources Center
  #1  
Old 12th June 2008, 11:48 AM
lehoanq Offline
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,
Reply With Quote
  #2  
Old 12th June 2008, 03:50 PM
bingoUV Offline
Registered User
 
Join Date: May 2007
Posts: 258
lsmod will tell you who is using the module. Remove the user module first.
Reply With Quote
  #3  
Old 12th June 2008, 05:17 PM
lehoanq Offline
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.
Reply With Quote
  #4  
Old 12th June 2008, 05:29 PM
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,291
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
Reply With Quote
  #5  
Old 12th June 2008, 05:48 PM
lehoanq Offline
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!
Reply With Quote
  #6  
Old 12th June 2008, 05:59 PM
bingoUV Offline
Registered User
 
Join Date: May 2007
Posts: 258
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.
Reply With Quote
  #7  
Old 12th June 2008, 06:47 PM
lehoanq Offline
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,
Reply With Quote
  #8  
Old 13th June 2008, 01:42 AM
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,291
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
Reply With Quote
  #9  
Old 13th June 2008, 02:47 AM
lehoanq Offline
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...
Reply With Quote
  #10  
Old 13th June 2008, 02:51 AM
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,291
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.
Reply With Quote
Reply

Tags
in use, module, remove

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problems while installing gnome 2.18, "no module named libxml2" and "libmodule_id" parv Using Fedora 1 30th March 2007 09:22 AM
nvidiia: "Failed to load module "nvidia-1.0-9746" StefanJ Hardware & Laptops 7 25th February 2007 03:56 AM
Linux Error -failed to load module "via"(module does not exists) jayantkm Installation, Upgrades and Live Media 1 25th December 2006 12:38 AM
Help, How to - Remove "Places" and "Desktop" Menus bwinfrey Using Fedora 7 5th May 2006 11:19 AM
Error:visibility arg must be one of "default", "hidden", "protected" or "internal" wangfeng Using Fedora 0 23rd May 2005 04:59 AM


Current GMT-time: 19:01 (Wednesday, 16-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat