All of lore.kernel.org
 help / color / mirror / Atom feed
* udev & sysfs - differentiating between usb / scsi devices
@ 2006-11-19 22:37 agonz054
  2006-11-20  0:19 ` Alex Merry
  0 siblings, 1 reply; 2+ messages in thread
From: agonz054 @ 2006-11-19 22:37 UTC (permalink / raw)
  To: linux-hotplug

After exploring the /sys file system structure, I have noticed that:
when a USB flash drive is hooked into the system two new objects are
introduced: one is a usb_device and the other is a scsi_disk.

Is there any way to differentiate between SCSI disks? ( i.e. i want two
browse through the scsi_disks present in sysfs and be able to see which
are usb flash drives and which are really scsi disks)

So far I have noticed that for several USB flash memories, the vendor
field/file in sysfs will contain "USB Flash Memory", but this doesn't
seem like a good solution to this problem.

Thanks,

Andy.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: udev & sysfs - differentiating between usb / scsi devices
  2006-11-19 22:37 udev & sysfs - differentiating between usb / scsi devices agonz054
@ 2006-11-20  0:19 ` Alex Merry
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Merry @ 2006-11-20  0:19 UTC (permalink / raw)
  To: linux-hotplug


[-- Attachment #1.1: Type: text/plain, Size: 1071 bytes --]

On Sunday 19 November 2006 22:37, agonz054@cs.fiu.edu wrote:
> After exploring the /sys file system structure, I have noticed that:
> when a USB flash drive is hooked into the system two new objects are
> introduced: one is a usb_device and the other is a scsi_disk.
>
> Is there any way to differentiate between SCSI disks? ( i.e. i want
> two browse through the scsi_disks present in sysfs and be able to see
> which are usb flash drives and which are really scsi disks)
>
> So far I have noticed that for several USB flash memories, the vendor
> field/file in sysfs will contain "USB Flash Memory", but this doesn't
> seem like a good solution to this problem.

How about looking at the device link?

I have a usb pen drive plugged in that turns up as sda.  
So /sys/block/sda/device links to 
../../devices/pci0000:00/0000:00:03.2/usb3/3-6/3-6:1.0/host0/target0:0:0/0:0:0:0/

Obviously, this is a usb device.

Alex :-)

-- 
Pippin
Computer Monkey to the Pelican
www.oxrev.org.uk, www.corpusjcr.org, www.rev.org.uk
0870 120 0870, ext 26669

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

[-- Attachment #2: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #3: Type: text/plain, Size: 226 bytes --]

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2006-11-20  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-19 22:37 udev & sysfs - differentiating between usb / scsi devices agonz054
2006-11-20  0:19 ` Alex Merry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.