Re: how to get serial_no from usb HD disk (HDIO_GET_IDENTITYioctl, hdparm -i)

From: Kay Sievers
Date: Sat Jan 06 2007 - 13:02:58 EST


On Sat, 2007-01-06 at 11:59 -0500, Stephen Clark wrote:
> Kay Sievers wrote:
> >On 1/6/07, Greg KH <greg@xxxxxxxxx> wrote:
> >>On Fri, Jan 05, 2007 at 12:27:34AM +0200, Yakov Lerner wrote:
> >>
> >>>How can I get serial_no from usb-attached HD drive ?
> >>>
> >>use the *_id programs that come with udev, they show you how to properly
> >>do that.
> >
> >Only "advanced" ATA-USB bridges will offer you the serial number the
> >adapter reads from the disk on power-up. The usual id-tools will just
> >work fine on theses bridges.
> >
> >There is no way to reach that information with most of the cheap USB
> >storage-adapters.

> I am looking to buy a usb to ata adapter can you name some of the
> advanced adapters?

I have a nice working bridge, in a no-name 2.5" disk-enclosure:
$ lsusb
Bus 005 Device 007: ID 04b4:6830 Cypress Semiconductor Corp. USB-2.0 IDE Adapter

$ scsi_id -x -g -p0x80 -s/block/sdb -d/dev/sdb
ID_VENDOR=TOSHIBA
ID_MODEL=MK1017GAP
ID_REVISION=0000
ID_SERIAL=STOSHIBA_MK1017GAP_144M6603
ID_SERIAL_SHORT=144M6603
ID_TYPE=disk
ID_BUS=scsi

$ /lib/udev/usb_id -x /block/sdb
ID_VENDOR=TOSHIBA
ID_MODEL=MK1017GAP
ID_REVISION=0000
ID_SERIAL=TOSHIBA_MK1017GAP_DEF107727402
ID_TYPE=disk
ID_BUS=usb

Another one just shows for exactly the same disk put behind the bridge:
$ lsusb
Bus 005 Device 012: ID 0402:5621 ALi Corp. USB 2.0 Storage Device

$ scsi_id -x -g -p0x80 -s/block/sdb -d/dev/sdb

$ /lib/udev/usb_id -x /block/sdb
ID_VENDOR=USB_2.0
ID_MODEL=Storage_Device
ID_REVISION=0100
ID_SERIAL=USB_2.0_Storage_Device
ID_TYPE=disk
ID_BUS=usb


Kay

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/