Skip to contentSkip to conversation

Question on the removable flag of USB devices

DISCUSSION Rogério Brito 3 participants 4 messages May 25, 2009 – May 26, 2009

lore
Share & tools
lore
#0 lore raw

Dear Alan,

Since we're talking about USB devices, I would like to ask you one
thing: I have some USB HD enclosures and I want to mount them with pmount, for instance.

Unfortunately, pmount won't allow the user to mount devices if it has the removable flag set to 0.

For instance, here is one of my external drives:

rbrito@chagas:~$ cat /sys/block/sda/removable 
0
rbrito@chagas:~$ 

The question is: how are devices determined to be removable or not? Sorry if this question is too naive.

Thanks,

Signature · 3 lines
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org
#1 lore raw
Quoted 2 lines · Rogério Brito

The question is: how are devices determined to be removable or not? Sorry if this question is too naive.

It's a bit that the device reports. The usb-storage driver passes this bit to the SCSI layer.

Matt

Signature · 6 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

NYET! The evil stops here!
					-- Pitr
User Friendly, 6/22/1998
#2 lore raw
Quoted 6 lines · Matthew Dharm
Quoted 2 lines · Rogério Brito

The question is: how are devices determined to be removable or not? Sorry if this question is too naive.

It's a bit that the device reports. The usb-storage driver passes this bit to the SCSI layer.

Wasn't this bit actually about removable _media_ rather than hotpluggable transports? (I.e. hardware where you can pull the medium out of the drive mechanism.) So in this sense, an USB attached HDD should actually not present itself as "removable" unless it's a SyQuest or Zip or something like that.

Furthermore, if that's what the discussed bit stands for, than it is rather arbitrary to base a policy on it whether a volume may be mounted by non-root users or not.

Rogério, perhaps static fstab entries based on /dev/disk/by-id/... can help.

Signature · 3 lines
Stefan Richter
-=====-==--= -=-= ==-=-
http://arcgraph.de/sr/
#3 lore raw
Quoted 5 lines · Stefan Richter
Quoted 4 lines · Matthew Dharm
Quoted 2 lines · Rogério Brito

The question is: how are devices determined to be removable or not? Sorry if this question is too naive.

Quoted 8 lines
Quoted 2 lines

It's a bit that the device reports. The usb-storage driver passes this bit to the SCSI layer.

Wasn't this bit actually about removable _media_ rather than hotpluggable transports? (I.e. hardware where you can pull the medium out of the drive mechanism.) So in this sense, an USB attached HDD should actually not present itself as "removable" unless it's a SyQuest or Zip or something like that.

In fact, yes, that's the meaning of that bit. The device indicates if the storage media may be removed from the device.

That said, a great many devices simply lie about this. Probably developers doing a cut-and-paste from templates which have the bit set one way or the other. The "popular" OSes don't seem to really care much about this bit...

Matt

Signature · 7 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

C:  Like the Furby?
DP: He gives me the creeps.  Think the SPCA will take him?
					-- Cobb and Dust Puppy
User Friendly, 1/2/1999