Skip to contentSkip to conversation

question on detecting a media change

DISCUSSION Oliver Neukum 2 participants 3 messages Feb 12, 2010 – Feb 17, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

Hi,

how can I find out a medium has been actually changed?
I find ASC 0x28 ASCQ 0x00 NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED in the tables but my card reader emits this when it wakes up from runtime suspension. How do you find out whether the medium has actually been changed?

Regards
Oliver

#1 lore raw
Quoted 7 lines · Oliver Neukum

Hi,

how can I find out a medium has been actually changed?
I find ASC 0x28 ASCQ 0x00 NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED in the tables but my card reader emits this when it wakes up from runtime suspension. How do you find out whether the medium has actually been changed?

Oliver,
What you see is what you get ... In the absence of Asynchronous Notifications (with USB, forget it) a SCSI target is passive. It knows the media might have changed but does not know if the same media has been put back in (or if something else caused the READY->NOT_READY->READY transitions).

So the next SCSI command sent to the device gets ignored and a Unit Attention (sense key) is issued with an additional sense code like the one you have shown. [At least that is what should happen.]
If you are lucky the SCSI subsystem does not swallow this deferred notification (a real pain for pass-throughs).

To detect the media has changed something at a higher level needed to get a unique key associated with the media before the Unit attention then generate another unique key from the media after the Unit attention. The comparison tells you the answer.

Doug Gilbert

#2 lore raw

Am Samstag, 13. Februar 2010 17:42:21 schrieb Douglas Gilbert:

Quoted 5 lines

To detect the media has changed something at a higher level needed to get a unique key associated with the media before the Unit attention then generate another unique key from the media after the Unit attention. The comparison tells you the answer.

Thanks. That's not the answer I would have liked, but it'll have to do.

Thanks
Oliver