[SATLUG] rmmod and insmod commands

John D Choate jdchoate at gmail.com
Sat May 23 13:53:27 CDT 2009


On Saturday 23 May 2009 12:59:04 Michael wrote:
> Todd W. Bucy wrote:
> > to start
> >
> > sudo modprobe <module>
> >
> > to remove
> >  
> > sudo rmmod <module>
> >
> >
> > look at the man pages for both command on your distro they have the
> > proper syntax
> >
> > Todd
> >
> > On Sat, 2009-05-23 at 10:09 -0500, Michael wrote:
> >   
> >> Jeremy Mann wrote:
> >>     
> >>> Michael, that is a soundcard module not a video card, but to remove
> >>> them you need to find what other modules are using that device. Since
> >>> it is a soundcard, I'd start with the snd-* modules and work your way
> >>> down.
> >>>       
> >> But that doesn't answer my question.  ;-)
> >>
> >> How to I stop and restart the modules once I find them?
> >>     
> 
> > I am trying to install a video card that is not being automatically
> > detected.  Following some directions I googled, after making changes to
> > my /etc/modprobe.d/options file, I am supposed to issue the following
> > commands:
> >
> > rmmod saa7134-alsa       < - - - - -  gives me a "module in use" error.
> > rmmod saa7134            < - - - - -  gives me a "module in use" error.
> > insmod saa7134.ko card=<card number>  {where <card number is an actual
> >  number, 1 - 125.}
> > insmod saa7134-also.ko
> >
> > This is supposed to be instead of rebooting the computer.  However, I
> > get a "module in use error" when I try to issue the rmmode command.  I
> > also tried the command modeprobe -r but I get the same "module in use
> > error."
> >
> > So, I guess me question is, I do I stop and restart the module
> 
> 
> Here is my original post.  I know what the commands are.  I am getting
> an error message "module in use" when I execute either rmmod or modprobe
> with the -r option.
> 
> I am not knowledgeable about modules.  Are they similar to what Windows
> calls processes or Linux services that can be stopped and restarted? 
> The reason I ask this is the verbage of the error, "module in use" makes
> it sound as if it can be stopped/restarted.  In any case, how do I avoid
> the "module in use" error?
> 
> 
> 
> 
> 
> 

About modules:
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/ch-kernel-modules.html

Are you trying to remove the module for the graphics card while X is running? Because X will load that module when it starts and I don't think X will let go of it until you stop X. So if you are doing this all in xterm or konsole, etc. then you should log out and drop to runlevel 3 and kill your desktop manager. I am not sure what system you are running and what differences there may be... but in my case I log out from KDE, press CTRL-ALT-F3, log in as root in TTY3, then pidof kdm followed by kill #### (the pid number) to kill kdm (might be gdm or gdm-bin instead of kdm for you). After that you should be able to do the modprobe -r modulename and issue the rmmod and insmod commands.
Or so I would think...


John



More information about the SATLUG mailing list