LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-26-2010, 02:11 AM   #1
masterav
Member
 
Registered: Aug 2008
Location: India
Distribution: redhat el5,fedora,centos
Posts: 30

Rep: Reputation: 0
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

Last edited by masterav; 12-26-2010 at 02:14 AM.
 
Old 12-26-2010, 07:37 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Have you tried compiling the kernel without support for usb storage?

Code:
# CONFIG_USB_STORAGE is not set
 
Old 12-29-2010, 11:40 AM   #3
masterav
Member
 
Registered: Aug 2008
Location: India
Distribution: redhat el5,fedora,centos
Posts: 30

Original Poster
Rep: Reputation: 0
Lightbulb 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....:
 
Old 09-24-2013, 01:36 AM   #4
vinnu550
LQ Newbie
 
Registered: Aug 2013
Posts: 5

Rep: Reputation: Disabled
not able to understand 1 & 2 steps

hai masterav can i have detailed explaination. what is happening in 1 & 2 commands?

Last edited by vinnu550; 09-24-2013 at 01:38 AM.
 
Old 09-24-2013, 10:14 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
#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.

Last edited by jpollard; 09-24-2013 at 10:15 AM.
 
Old 09-24-2013, 11:27 PM   #6
vinnu550
LQ Newbie
 
Registered: Aug 2013
Posts: 5

Rep: Reputation: Disabled
thank you jpollard. then how to enable usb storage after disable.

Last edited by vinnu550; 09-24-2013 at 11:29 PM.
 
Old 09-25-2013, 02:05 PM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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.

Last edited by jpollard; 09-25-2013 at 02:07 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
M using Mint 8, Helena. Reqmt is to disable all usb storage media. sumant Linux - Newbie 1 08-07-2010 11:10 AM
disable USB storage Ubuntu 8.10 Ipolit Linux - Hardware 2 03-01-2010 07:24 AM
Disable/enable USB storage device @ run time Mr.J Linux - Kernel 3 08-03-2008 08:14 AM
How to disable USB Mass Storage device ( usb drive ) in Linux vijaush Linux - Newbie 4 06-25-2008 09:43 AM
Is it possible to disable power supply to an USB storage device when unmounting? costavi Linux - Hardware 2 11-14-2006 03:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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