public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question on the removable flag of USB devices
@ 2009-05-25 16:45 Rogério Brito
  2009-05-25 18:48 ` Matthew Dharm
  0 siblings, 1 reply; 4+ messages in thread
From: Rogério Brito @ 2009-05-25 16:45 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-kernel, linux-usb

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,

-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on the removable flag of USB devices
  2009-05-25 16:45 Question on the removable flag of USB devices Rogério Brito
@ 2009-05-25 18:48 ` Matthew Dharm
  2009-05-26 16:36   ` Stefan Richter
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Dharm @ 2009-05-25 18:48 UTC (permalink / raw)
  To: Rogério Brito; +Cc: Alan Stern, linux-kernel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

On Mon, May 25, 2009 at 01:45:54PM -0300, Rogério Brito wrote:
> 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

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

NYET! The evil stops here!
					-- Pitr
User Friendly, 6/22/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on the removable flag of USB devices
  2009-05-25 18:48 ` Matthew Dharm
@ 2009-05-26 16:36   ` Stefan Richter
  2009-05-26 17:34     ` Matthew Dharm
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Richter @ 2009-05-26 16:36 UTC (permalink / raw)
  To: Rogério Brito; +Cc: Alan Stern, linux-kernel, linux-usb

Matthew Dharm wrote:
> On Mon, May 25, 2009 at 01:45:54PM -0300, Rogério Brito wrote:
>> 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.
-- 
Stefan Richter
-=====-==--= -=-= ==-=-
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on the removable flag of USB devices
  2009-05-26 16:36   ` Stefan Richter
@ 2009-05-26 17:34     ` Matthew Dharm
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Dharm @ 2009-05-26 17:34 UTC (permalink / raw)
  To: Stefan Richter; +Cc: Rogério Brito, Alan Stern, linux-kernel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 1340 bytes --]

On Tue, May 26, 2009 at 06:36:09PM +0200, Stefan Richter wrote:
> Matthew Dharm wrote:
> > On Mon, May 25, 2009 at 01:45:54PM -0300, Rogério Brito wrote:
> >> 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.

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

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-26 17:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-25 16:45 Question on the removable flag of USB devices Rogério Brito
2009-05-25 18:48 ` Matthew Dharm
2009-05-26 16:36   ` Stefan Richter
2009-05-26 17:34     ` Matthew Dharm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox