asr/hdiutil has no way to determine if image is scanned for restore

Originator:iwilliams
Number:rdar://11629642 Date Originated:08-Jun-2012 04:34 PM
Status:Open Resolved:
Product:Mac OS X Product Version:10.7.4
Classification:Feature (New) Reproducible:Always
 
08-Jun-2012 04:34 PM iwilliams:
Summary:
None of the command-line tools used for disk image processing have a way to determine if an image is scanned for restore.

Steps to Reproduce:
Note that when using the command line tools to verify a group of disk images, there is no way to determine if an image is scanned for restore.

No available documentation seems to indicate this is possible without initiating a restore process in asr.  If the image is not scanned, asr will exit and let the user know that the image needs to be scanned first.  There does not appear to be any other way to obtain this information.

Expected Results:
Ideally, there would be an option in either hdiutil or asr to check for imagescan data and report to the user if the image can be restored before attempting the restore process.

Actual Results:
None

Regression:
I have not found documentation that indicates this has ever been possible.

Notes:
There seem to be two workarounds, neither of which are practical and one of which is expressly not recommended by Apple:

1. Using the --noverify option in asr, one can restore an unscanned image to the destination, but the documentation explicitly states this is dangerous and should not be used in production systems.

2. One can create a temporary disk image file, initiate a restore function to the temporary disk image, and if the process does not immediately fail, terminate the restore to the temporary image with the understanding that the image WAS already scanned for restore.  This is feasible, but certainly not practical.

10-Jun-2012 03:36 PM iwilliams:
I was hoping that having asr attempt to restore an image to /dev/null would cause asr to fail and return an error for unscanned images before it attempted to verify the destination (and therefore fail, possibly with a different exit value)

However, it appears that asr verifies the destination before the source, so this potential workaround is not possible.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!