Re: Identifying CD drives across reboots
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Organization: HoffmanLabs LLC User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031) 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Stephen Hoffman