LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 06-24-2008, 07:17 AM   #1
vijaush
LQ Newbie
 
Registered: Feb 2007
Posts: 8

Rep: Reputation: 0
Unhappy How to disable USB Mass Storage device ( usb drive ) in Linux


hi all,

How can i disable usb drive in Linux, on Windows it can be easily done
by setting Registry key
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor\Start" to 4.

How can i disable usb drive in Linux ??

Thanks for any help
 
Old 06-24-2008, 08:01 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,759

Rep: Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613
In linux it's even more easily done, by unloading the usb_storage module:

modprobe -r usb_storage

from the command line.
 
Old 06-24-2008, 11:24 AM   #3
elliott678
Member
 
Registered: Mar 2005
Location: North Carolina
Distribution: Arch
Posts: 977

Rep: Reputation: 72
Quote:
Originally Posted by TB0ne View Post
In linux it's even more easily done, by unloading the usb_storage module:

modprobe -r usb_storage

from the command line.
To make this permanent you will have to blacklist the module, to prevent it from loading on reboot. You didn't mention which distro you are using, so I can't give specific instructions on that.

EDIT: I just tried this on my system, unloaded the usb_storage module, then plugged in a thumb drive, the module was reloaded and the drive auto mounted.

Are you just looking to turn off auto mounting, or do you want to totally disable the ability to use a USB drive?

Last edited by elliott678; 06-24-2008 at 11:27 AM.
 
Old 06-25-2008, 01:19 AM   #4
vijaush
LQ Newbie
 
Registered: Feb 2007
Posts: 8

Original Poster
Rep: Reputation: 0
hey,

thanks for the reply.
I am using Fedora Core 7.

when i tried to run "modprobe -r usb_storage" it said "FATAL: Module usb_storage is in use"
to solve this i unmounted the device "umount /dev/sdb" and the again issued "modprobe -r usb_storage" this time it worked.

but when i removed the device and inserted it back, it was mounted again.

after this i tried following:

1. Unmounted the device. "umount /dev/sdb"
2. removed the module. "modprobe -r usb_storage"
3. edited /etc.modprobe.d/blacklist and appended "blacklist usb_storage"
4. remove the device and inserted it back, but it was mounted again

Thinking that the blacklist is not refreshed, i rebooted the PC and plugged the device again, but this time also it was mounted.

How can i make this permanent.

elliott678:
"Are you just looking to turn off auto mounting, or do you want to totally disable the ability to use a USB drive?"

No, I don't want to turn off auto mounting, nor do i want to disable it permanently.
I just want to disable it for some time and then enable it back("without rebooting the PC")

Any suggestions/comments ???
 
Old 06-25-2008, 09:43 AM   #5
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,393
Blog Entries: 1

Rep: Reputation: 64
may be this thread may help:
http://www.linuxquestions.org/questi...-basis-623341/
 
  


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
Mass storage device USB xeebeeeeeee Linux - Hardware 10 02-13-2008 12:11 PM
USB Mass storage Device purefan Linux - Hardware 15 06-06-2005 01:56 PM
USB Mass Storage Device ebasi Linux - Hardware 2 12-23-2004 02:06 PM
Accessing USB Mass storage device in Linux..?? kvsmani Linux - Hardware 0 02-11-2004 12:03 PM
Usb mass storage device laguna Linux - Hardware 4 08-12-2002 02:16 AM


All times are GMT -5. The time now is 08:43 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration