X-No-Archive: yes

Hi,

I am trying to read the serial ID from SanDisk Compact Flash cards in
a Linux system. When using one of these cards inside a mini computer
(which is using the CF cards as HD replacement and mounts them/treats
them as IDE devices), it is trivial to request the serial (in C) with

ioctl (fd, HDIO_GET_IDENTITY, &diskid);

which is working great. But when addressing a CF card as mass storage
device (e. g. by a USB multi-card reader), I did not yet figure out
how to request the ID. Neither hdparm/sdparm nor other tools were
able to determine the ID of the CF card, nor did I find a system API
(or similar) to request it.

I was able to get the ID from a 512MB USB stick w/o a problem (by USB
API calls). But w/ the multi-card reader, I just get the serial ID
from the card reader (which is then 000001), not from the card plugged
into one of the interfaces (e. g. /dev/sdb).

Does anybody has a glue, if there is a way to determine the serial ID
from a Compact Flash card over USB/mass storage device API, kernel API
or a tool, which is able to do that?

BR,
- Alex