LinuxQuestions.org
Visit Jeremy's Blog.
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, 03: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 03:14 AM.
 
Old 12-26-2010, 08:37 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

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

Code:
# CONFIG_USB_STORAGE is not set
 
Old 12-29-2010, 12:40 PM   #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, 02: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 02:38 AM.
 
Old 09-24-2013, 11:14 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,714

Rep: Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280
#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 11:15 AM.
 
Old 09-25-2013, 12:27 AM   #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-25-2013 at 12:29 AM.
 
Old 09-25-2013, 03:05 PM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,714

Rep: Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280
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 03:07 PM.
 
  


Reply


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

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

All times are GMT -5. The time now is 01:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration