LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to disable only usb-storage in Centos 5.5? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-disable-only-usb-storage-in-centos-5-5-a-852415/)

masterav 12-26-2010 02:11 AM

How to disable only usb-storage in Centos 5.5?
 
Hi,

I'm using centos 5.5,my problem is that i need to disable usb-storage in my machine.But i need usb mouse and usb keyboard to function properly.I have tried all the below mentioned methods,

1.Appending blacklist-usbstorage to /etc/modprobe.d/bl*
2.removing the *.ko file,which removes the usb-storage drivers.
3.Added the line, install usb-storage /bin/true to /etc/modeprobe.conf

The first mentioned method works partially.That is the usb port in the front panel of the cpu is gets disabled.But,when i insert it at the port behind the CPU, usb-storage(pendirve) mounts automatically,which should not happen.


NOTE:usb-storage have to be disabled only for normal-users




Thanks in advance

andrewthomas 12-26-2010 07:37 AM

Have you tried compiling the kernel without support for usb storage?

Code:

# CONFIG_USB_STORAGE is not set

masterav 12-29-2010 11:40 AM

Disable only usb storage in linux...Solved
 
Hi,


Finally i got it right...so here is what i did....

1.echo 'blacklist usb_storage' > /etc/modprobe.d/blacklist-usb_storage
2.echo 'modprobe -r usb_storage' > /etc/rc.local
3.reboot

Now all usb_storage will be disabled except usb mouse and keyboard.


Thanks Andrewthomas anyway....:;)

vinnu550 09-24-2013 01:36 AM

not able to understand 1 & 2 steps
 
hai masterav can i have detailed explaination. what is happening in 1 & 2 commands?

jpollard 09-24-2013 10:14 AM

#1 configures the modprobe utility to ignore the usb storage module - thus it will not be loaded if requested

#2 removes the usb storage module from the kernel. Without doing this it would take a reboot before the first command had any real effect - the module would still be loaded.

That said, #2 shouldn't be needed as the first command is an on-disk configuration change.

vinnu550 09-24-2013 11:27 PM

thank you jpollard. then how to enable usb storage after disable.

jpollard 09-25-2013 02:05 PM

undo #1. delete the file "/etc/modprobe.d/blacklist-usb_storage"

If step #2 was also done, remove the command from /etc/rc.local (which could have other things in there. If not, just delete the file.)

I believe once the file is deleted it would work, though it might require a reboot or restart of udev.


All times are GMT -5. The time now is 08:27 PM.