Re: Q: how to send ATA cmds to USB drive?

Robert Hancock
2006-05-24T23:16:05Z

Herbert Rosmanith wrote:
> good day,
>
> I have a question concerning sending arbitrary ATA commands to an USB
> drive.
>
> Currently, I have a particular application which sends special ATA commands
> to an IDE drive using IDE_TASKFILE. So far, this works pretty well.
>
> But now I also have to support USB harddisks from the same company.
> The USB harddisk uses the same set of ATA commands as the IDE harddisk,
> well, at least that's what I suppose.
>
> How do I send ATA commands to this USB drive? I suppose this would be
> done via SG_IO (the drive is recognised by linux as usb-storage, of
> course), but how exactly does this have to be done? I have already
> used SG_IO before to send some MMC commands to cdvd-drives, but I
> don't know how to send ATA (such as those from T13) commands with this
> interface.

Short answer is you likely can't. The USB-to-IDE bridge pretty much
entirely hides the fact that it's an IDE drive behind it, from the
host's viewpoint it looks pretty much like SCSI. Maybe if you sent SCSI
commands to the device it would translate them into the correct ATA
commands, depending on what exactly you're doing, but that's entirely
dependent on the bridge chip in question and I would guess most of them
don't support such fancy operations.

--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/