LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 07-19-2007, 08:58 PM   #1
peets
LQ Newbie
 
Registered: Jul 2007
Location: Montreal
Distribution: archlinux
Posts: 3

Rep: Reputation: 0
Toggling the 'removable' flag on a hard drive


Hi,

I have an external hard drive that plugs in through usb. A few months ago I redid the filesystem a few times (tried to install a liveUSB distro, among others) using different machines (linux, windows, mac). In the end, I had a single partition with an empty vfat filesystem on it (which is pretty much how it came when I bougt it).

However, the drive is no longer recognized as 'removable' by windows or mac or linux (pmount says it's not removable). I'm wondering how to make the hard drive recognized as removable media once again. There seems to be a 'removable' flag that can be toggled:
Code:
[peets@myhost sys]$ grep '\w' /sys/block/sdb/*
/sys/block/sdb/dev:8:16
/sys/block/sdb/range:16
/sys/block/sdb/removable:0
/sys/block/sdb/size:234441648
/sys/block/sdb/stat:      29       73      354      268        0        0        0        0        0      216      268
[peets@myhost sys]$
Notice the line that says
Code:
/sys/block/sdb/removable:0
How do I go about and chage this file to read '1'? This has to do with the hardare: it is not recognized as removable on ms-windows either. Is there any software that can do low-level stuff like this?
 
Old 07-21-2007, 07:45 AM   #2
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Maybe using fdisk in expert mode can take care of it. Just type fdisk [device] into your terminal, then m to see the various options. if you don't see anything relevant, you can choose x for expert mode.
 
Old 07-21-2007, 08:16 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
I don't find anything relevant in fdisk.

My USB drive also shows up with "0" for that flag. The only things in my system that show "removable" are the optical drives and the compact flash reader. I don't think this a flag you can toggle---it seems to be a property of the hardware that gets detected when it is connected/turned on.
 
Old 07-21-2007, 03:29 PM   #4
peets
LQ Newbie
 
Registered: Jul 2007
Location: Montreal
Distribution: archlinux
Posts: 3

Original Poster
Rep: Reputation: 0
Yeah, this topic is never mentionned anywhere... maybe it's impossible? But, when I first bought the hard drive, it was recognized as removable. It's only after making a new filesystem (using Windows, I think - I really don't remember how I did this, it was many months ago) that the drive was no longer recognized removable.

I'm asking for support directly from the company, see if they can come up with anything... (maybe they'll give me a new hard drive ? )
 
Old 07-21-2007, 05:56 PM   #5
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Which is what led me to the whole fdisk idea. If the disk was removable at first and became un-removable only later, then clearly this involves some information bit on the disk that can be toggled on or off in the MBR. Anyway, since the damage was caused by Windows, I'm not sure whether a solution can be found using Linux fdisk. Btw, what happens if you go into Windows, disconnect the drive using the "remove safely" thing and plug it in again?
 
Old 07-22-2007, 12:46 PM   #6
Crito
Senior Member
 
Registered: Nov 2003
Location: Knoxville, TN
Distribution: Kubuntu 9.04
Posts: 1,168

Rep: Reputation: 53
Windows assigns the removable flag to the drive letter, not the media mounted there. So if you swap drives or change the boot order in BIOS this sometimes happens.

Try deleting the device in Device Manager and rebooting.
 
Old 07-23-2007, 09:56 PM   #7
peets
LQ Newbie
 
Registered: Jul 2007
Location: Montreal
Distribution: archlinux
Posts: 3

Original Poster
Rep: Reputation: 0
I think jay73 is on the better track for this one: I plugged it into a computer it had never touched before and it was treated as an internal hard drive there too. But I don't think fdisk can do anything about this, unless it has features that are not documented in the man page (I litterally RTFM on this one!)
 
Old 07-23-2007, 10:17 PM   #8
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
What if you go into windows device manager, right click and select Properties? Can you switch to removable? This option existed on Windows 98 but I'm not sure whether it still does on XP. If nothing helps, you may want to look on the site of the manufacturer whether they have a zero-filling tool available for download.

Last edited by jay73; 07-23-2007 at 10:20 PM.
 
Old 07-23-2007, 11:11 PM   #9
Crito
Senior Member
 
Registered: Nov 2003
Location: Knoxville, TN
Distribution: Kubuntu 9.04
Posts: 1,168

Rep: Reputation: 53
Well, my 3.5" card reader, for example, was detected as an internal drive by XP until I updated the driver. Then it showed up as a removable drive. There's no Vista driver for it, so now that I've upgraded it's showing up as internal again. The flash card I use doesn't matter.

If you have another external enclosure that's working right just swap the drives and see what happens. If it suddenly shows up as removable again you can eliminate the drive as a possibility and focus on the driver, as I originally suggested.
 
Old 07-23-2007, 11:30 PM   #10
Crito
Senior Member
 
Registered: Nov 2003
Location: Knoxville, TN
Distribution: Kubuntu 9.04
Posts: 1,168

Rep: Reputation: 53
Quote:
Originally Posted by jay73
... you may want to look on the site of the manufacturer whether they have a zero-filling tool available for download.
Or you could just use dd if=/dev/zero
 
  


Reply

Tags
device, drive, filesystem, hard, partition, removable


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
Unmounting removable IDE hard drive gusx Linux - Hardware 3 09-29-2005 11:18 AM
Install Linux on a Removable Hard Drive SuperSadSmile Linux - General 6 05-11-2005 04:47 AM
Linux on removable Hard Drive hobz Linux - Newbie 1 02-19-2005 01:09 PM
setting using dma flag on hard drive? danny678010 Linux - Hardware 3 08-27-2003 09:43 PM
Removable hard drive question eastj1974 Linux - Newbie 3 05-23-2003 08:51 AM


All times are GMT -5. The time now is 01:48 AM.

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