(NOT SOLVED YET)) How to disable USB storage only (USB headets should continue to work)
Tom H
tomh0665 at gmail.com
Fri Apr 9 19:19:11 UTC 2010
On Fri, Apr 2, 2010 at 4:03 PM, J <dreadpiratejeff at gmail.com> wrote:
> On Fri, Apr 2, 2010 at 14:51, David Taveras <d3taveras38d3 at gmail.com> wrote:
>> Hello guys..
>>
>> Iam trying to disable only usb-storage support. I have rm -fr
>> /lib/modules/2.6.31-20-generic/kernel/drivers/usb/storage/ .. and then
>> rebooted.
>>
>> If i pop in a USB drive once its booted back then it works as expected
>> (cannot mount the USB drive) .. but if I pop in the USB drive while
>> the OS is booting once it enters the deskptop i see the drive already
>> mounted. What is the correct way to do this?
>>
>> I also tried:
>>
>> # echo 'install usb-storage : ' >> /etc/modprobe.conf
>>
>> Ive noticed that when I do the test of inserting the USB driver before
>> the OS boots when it comes up there is a directory created by the OS
>> in /sys/bus/usb/drivers/usb-storage
>>
>> Where is the OS still loading the drivers from? I only have 1 kernel installed.
>
> The short answer is: when you plug a device in on a system that's
> already booted, the drivers can't load because you've deleted them
> from /lib/modules/`uname -r`/kernel/drivers/??
>
> However when you boot the system with USB drives attached, the
> usb-storage module is being loaded into memory from the initrd file at
> boot time.
>
> I'd bet that if you removed all references to usb-storage in
> modprobe.conf, and deleted the drivers, then did a depmod -a, and then
> rebuilt the initrd, you'd probably see this behaviour disappear.
>
> For a quick test, boot the system with USB drives attached. Then,
> remove the drives, and rmmod the usb-storage driver. Then plug the
> USB drive back in and see what happens. That'll probably make my
> explanation a little more clear.
Add the following to /etc/modprobe.d/usb-storage.conf
install usb-storage /bin/true
so that every time the usb-storage module is called to be loaded, it isn't.
More information about the ubuntu-users
mailing list