LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 08-15-2006, 01:15 AM   #1
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Rep: Reputation: 47
Disable hotplug autoload of usb_storage module


Distro: Gentoo

I need hotplug/coldplug because of my scanner, however I also have some usb mass storage equipment. I do not want the usb_storage module to load on startup. When it starts it completely fills my dmesg kernel info with usb_storage errors. so, basically I need hotplug, I need it to load on startup, I need it to NOT load usb_storage, I cannot disconnect my mass-storage devices, and simply unloading it after boot is not a solution.

I have gone into my /etc/hotplug/usb.* and removed any and all mentions of usb_storage, no luck still loads.
 
Old 08-15-2006, 07:52 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
When it starts it completely fills my dmesg kernel info with usb_storage errors.
I get the idea you're looking at the symptoms and not the cause. If verbose dmesg output is the main reason for wanting this then wouldnt it make sense to either fix the errors or else not have them shown or logged? Are these really error messages or just the informational level usb-storage ones you can ignore? If it's the informational level ones then a kernel configure (unset CONFIG_USB_STORAGE_DEBUG) and recompile gets rid of verbose USB messages. If it's errors why not post a few exact lines? If you OTOH need to get a clear view of dmesg information for specific causes, couldn't a grep pipe help?
 
Old 08-15-2006, 11:38 AM   #3
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Original Poster
Rep: Reputation: 47
when I say it fills it I mean it filles it, dmesg | less from top to bottom with usb_storage.

I was pretty sure I had verbose debugging disabled on the kernel config, but I checked and apparently not, probably a typeo. hopefully now that I changed that and recompiled it shoudl work (not rebooting now)

This output is not the only reason I do not want the module to load:
I have 2 reasons for compiling a kernel option as a module.
1) I rarely use it and I do not want it in my active kernel, speed/memory reasons, sometimes security.
2) Sometimes modules need to load in a specific order, for instance drive controllers, if I do not specify the order of drive controllers by loading the modules in a startup script (or /etc/modules.d/modules-autoload-2.6).

example (bare with it, it does involve usb_storage):
I have 2 onboard sata controllers, I have the sata_nv and the sata_sil, the sata_nv is builtin cause it has my root drive, the sata_sil autoloads on boot. I do this because different kernel versions seem to alternate the order in which the sata drivers are loaded, so after some recompiles I would need to change /boot/grub/grub.conf and /etc/fstab, I got tired of changing these files after kernel version updates. So I simply builtin the first one and autoloaded the second. Now then I do not have usb_storage builtin a) because I rarely use it, and B if it loaded before the sata_sil then the drive order would be changed again because the mass_storage would add my card reader as 4 sdX devioce nodes before the disks on my sata_sil. Once again we have a drive order issue that f*cks up fstab. and I cannot be sure what the sata_sil drives will have for their order because I have a usb harddrive that I mave so it is not always at the computer.

In short I need the usb_storage module from tiem to time, but I really cannot have it load automatically by hotplug, yet I cannot stop using hotplug because It makes my scanner work, and I do use my scanner often (In fact I have never had hotplug installed up until a week ago when I got my new scanner).
 
Old 08-16-2006, 07:44 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I was pretty sure I had verbose debugging disabled on the kernel config, but I checked and apparently not, probably a typo. hopefully now that I changed that and recompiled it should work
It will.


1)I do not want it in my active kernel, speed/memory reasons, sometimes security.
Yes, disabling modules makes the kernel smaller and faster, but the usb-storage module doesn't noticably decrease kernel performance nor does it noticably use memory. I'd say you only could notice a significant decrease in performance when you load a say every existing module. There are no security issues related to this module AFAIK.


In short I need the usb_storage module from tiem to time, but I really cannot have it load automatically by hotplug, yet I cannot stop using hotplug because It makes my scanner work
There's three options then:
- Disable hotplug, load scanner modules manually from script.
- Move the usb-storage LKM to another directory say /lib/modules/noload and remove all references in modules.usbmap, load usb-storage modules manually from script.
- The first two options will break functionality and they are not standard. So maybe blacklisting the usb-storage module in /etc/modprobe.conf, Udev rules and wherever else it's mentioned could be a "better" option. If you're using Udev then you can also make rules that explicitly state in which order to load modules.
 
  


Reply



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
mepis 3.3 with 2.6.10 kernel e1000 nic module autoload bredfern Linux - Hardware 0 06-02-2005 04:49 PM
Slackware 10: How do you disable hotplug at startup? jtp51 Slackware 6 10-29-2004 04:14 PM
Disable hotplug or USB device in Fedora Core 2 crashdum Fedora 1 09-03-2004 08:01 AM
disable usb hotplug service ? YBA^[x] VectorLinux 1 08-23-2004 12:18 PM
Mouse problems... How do I disable hotplug? EThitop Linux - Newbie 2 06-06-2004 07:54 PM

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

All times are GMT -5. The time now is 07:38 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