Re: Identifying CD drives across reboots
Re: Identifying CD drives across reboots
- Subject: Re: Identifying CD drives across reboots
- From: Stephen Hoffman <email@hidden>
- Date: Tue, 18 Dec 2007 16:00:14 -0500
- Organization: HoffmanLabs LLC
My next idea was to use the drive's serial number via
kIOPropertyProductSerialNumberKey, but while
IOStorageDeviceCharacteristics.h says the key is mandatory...
Only a subset of SCSI devices (USB, ATAPI, SAS, etc) I've worked with
have "real" serial numbers. Some devices are specified by the OEM with
a Vendor, err, Vital Private Data (VPD; page 80h) structure, and the
serial number can be stored there. Some don't have the VPD.
A few (rare) devices are specified with host-writable areas; that was an
approach that one vendor used to identify its widgets in a SAN fabric
when multiple paths are present. Some devices (eg: USB keyboards)
seldom seem to have any sort of unique identity.
Being that this is an optical drive, you can't use the expedient of
writing something identifiable onto the media.
Is there another way to accomplish what I am trying to do?
Not easily; not that I can think of based on what responses I've seen
returned from more CD and DVD devices than I care to count.
You can certainly poke at the VPD and that the serial number feature,
and potentially derive a hash from the device model and firmware
information as a fallback, but there's a reasonable shot of duplicates.
Some combination of an INQUIRY and MODE_SENSE_n commands, or a
GET_CONFIGURATION for a serial number feature (108h), if the drive has that.
Disks don't necessarily have a VPD, and commodity devices tend not to.
But for further details on this, see the VPD stuff in the SCSI Primary
Commands (SPC) documentation, and the GET_CONFIGURATION features in the
MultiMedia Command (MMC) documentation, over at the T10.org site. These
will give you some idea of where to look out in the device.
And you just never know what a SCSI device is going to toss back at you.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden