Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-10-2008, 04:49 PM   #1
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
How Can I Force Removal of a Kernel Module (ERROR: Module usb_storage is in use)

Hi guys,

I'm trying to get my mobile phone to act as a modem and yet it seems kernel only sees it as usb storage. I was advised to remove usb_storage and usbserial kernel modules and then reload usbserial with vendor/device parameters.

When I plug in the phone and try to

sudo rmmod usb_storage
I get

ERROR: Module usb_storage is in use
I cannot use 'rmmod --force' as my kernel was not compiled with CONFIG_MODULE_FORCE_UNLOAD.

Is there a way to go about it?

Here is /var/log/messages output:

Oct 10 22:35:31 dell-desktop kernel: [ 144.321715] usb 5-1: new full speed USB device using uhci_hcd and address 4
Oct 10 22:35:31 dell-desktop kernel: [ 144.483995] usb 5-1: configuration #1 chosen from 1 choice
Oct 10 22:35:31 dell-desktop kernel: [ 144.588841] usbcore: registered new interface driver libusual
Oct 10 22:35:31 dell-desktop kernel: [ 144.633577] Initializing USB Mass Storage driver...
Oct 10 22:35:31 dell-desktop kernel: [ 144.634977] scsi5 : SCSI emulation for USB Mass Storage devices
Oct 10 22:35:31 dell-desktop kernel: [ 144.636212] usbcore: registered new interface driver usb-storage
Oct 10 22:35:31 dell-desktop kernel: [ 144.636220] USB Mass Storage support registered.
Oct 10 22:35:36 dell-desktop kernel: [ 148.547870] scsi 5:0:0:0: CD-ROM S2 Driver CDROM 2.31 PQ: 0 ANSI: 2
Oct 10 22:35:36 dell-desktop kernel: [ 148.567679] sr1: scsi3-mmc drive: 0x/0x caddy
Oct 10 22:35:36 dell-desktop kernel: [ 148.567829] sr 5:0:0:0: Attached scsi generic sg2 type 5
Old 10-10-2008, 08:08 PM   #2
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,799

Rep: Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158
Do the unload and reload of the module before plugging the phone (or any USB device) in ???. Best immediately after a reboot.
Old 10-10-2008, 09:20 PM   #3
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,372
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
root@GamesBox:/bin# rmmod --help (11-10 12:19)
Usage: rmmod [-fhswvV] modulename ...
-f (or --force) forces a module unload, and may crash your
machine. This requires the Forced Module Removal option
when the kernel was compiled.
-h (or --help) prints this help text
-s (or --syslog) says use syslog, not stderr
-v (or --verbose) enables more messages
-V (or --version) prints the version code
-w (or --wait) begins a module removal even if it is used
and will stop new users from accessing the module (so it
should eventually fall to zero).
root@GamesBox:/bin# (11-10 12:19)
rmmod -r usb-storage or

rmmod -w usb-storage (that should not allow anyone new to use the module, and keep everything already using it happy.)

then run modprobe usbserial vendor=0x12d1 product=0x1003

Get the vendor and product id's from...


I used this at first, but on recent versions of the kernel the module "option" is built in and can be used for the 3g modem.

There are a few other steps, like lsusb to find the modem address,

and dmesg to monitor the start up activity.

A quick search for rmmod -r usb-storage showed 3g modem configs, and solutions.

I use the huawei e220 and, without VMC (never works, dep hell)

See how you go, in the linked page are instructions to get it working, but you may not need to do all of that.

Cheers, Glenn


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
error: -1 Invalid module format when using insmod with module cross-compiled for arm AndrewShanks Linux - Embedded & Single-board computer 4 10-15-2007 03:50 AM
insmod: error inserting 'module.o': -1 Invalid module format ksrinivas Linux - Newbie 5 10-11-2006 07:29 AM
[Error] Kernel Module : No kernel module build environment saman007uk Debian 7 09-09-2006 06:34 PM
Disable hotplug autoload of usb_storage module exodist Linux - General 3 08-16-2006 07:44 AM
Kernel module programming Error : module not found coolguy_iiit Programming 1 07-30-2006 07:23 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration