On Tue, Sep 13, 2011 at 11:18 AM, Ilya Chernykh <anixxsus@gmail.com> wrote:
On Tuesday 13 September 2011 18:22:40 Greg KH wrote:
It is obviously incorrect, if to follow the Lanana specification, and any intuitive logic. Why this driver uses SCSI names for USB devices?
Because USB storage devices are really just SCSI devices, look at the USB storage spec for details if you are curious.
Wow. On my system all disks except the DVD drive are4 shown as with sd* name. Does it mean the SATA drive is also a SCSI drive? I also have an IDE drive attached via a parallel cable, is it also a SCSI drive? This becomes ridiculous.
Libata was developed for 2.6. It should have been a from scratch full fledged driver. Instead they decided to take advantage of the SCSI exception handling stack. When 2.6 first came out most distros used /dev/hda etc. and the associated old drivers/ide kernel code. Over time most of the functionality of drivers/ide was migrated (or re-implemented) in libata. A couple years ago the linux kernel team made a decision to put drivers/ide into a maintenance only mode. It should no longer be getting new drivers or functionality. Obviously most general purpose distros are now using libata by default. Unfortunately libata is still under the scsi stack, so it gets the /dev/sdx style names. You can argue its a bug, but in reality it's a design decision that is way outside of the opensuse communities control.
There are different backends that use different methods. Currently KDE3 has two backends: a HAL backend that uses HAL api, and mtab/fstab backend that scans mtab table. HAL backend will be useless in a system without hal.
Also note that mtab/fstab backend is the most universal because any system no and in the future will have there tables, regardless whether it has udisks or other more complicated components.
But it sounds like the mtab/fstab backend is buggy. Please fix it :)
It is impossible to determine whether a given drive an USB drive or hard based on mtab only if the both use similar sd* name.
The name is not a API. You should be looking at /sys/block/sda. That directory is full of useful things. For instance /sys/block/sda/removable should contain a zero or one depending on the nature of the storage. And /sys/block/sda/queue/rotational should contain the rpms of a rotating disk, or zero (for unknown), or one (for solid state disk). Unfortunately the rotational file is not very accurate. I just checked on this workstation and my rotating disk is identified as solid-state per that field. Can't say I'm overly surprised.
> > > > Thus the mtab backend thinks about USB drives as of hard disks.
Lots of them are hard disks :)
Still this is incorrect, there in a "removable" device type that should be used. When using hal, the usb drives are shown with "flash drive" icon.
That's wrong then, fix HAL :)
This is completely correct. I insert a flash drive and see it as a flash drive.
It is actually interesting why USB devices are assigned SCSI-names, and should not they receive USB names.
No it isn't, it's been that way for over 10 years now, nothing new here at all
As I already said this contradicts at least the Lanana specification adopted in 2009. Even if this was the case for a long time, it obviously contradicts the modern specification.
Again, no, it does not, your USB device is really using the SCSI stack, so it is a SCSI device.
Do you have a prooflink?
I'm pretty sure that SCSI is actually a network stack based protocol. (ie. the standard 7 layer model). Much like TCP sits on IP sits on eithernet sits on cat5. USB is actually an official part of the SCSI stack I believe. So the commands that are transmitted over the USB cable are real SCSI commands, just as the packets that are transmitted over cat5 carry TCP packets. So USB being part of the SCSI stack is the correct and proper way to do it. Greg -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org