"Restore Failure #
Could not validate source - Operation not supported" kept appearing in Disk Utility as I tried unsuccessfully to restore a bootable USB flash drive image to a new USB flash drive. The asr workaround did not work either, returning Source volume format on device "/dev/disk3" is not valid for restoring. Could not validate source - error 254.
By happy chance, I stumbled onto Max's answer which credited drgeoff's reply, which linked to PureDarwin's Disk images page. The secret was to convert the image format to raw before writing with dd (attempting to restore even the converted image via Disk Utility returned the same "Restore Failure" error above).
Here is the process I used to backup my DiskWarrior bootable USB flash drive and restore it to a new flash drive:
Backup
- Insert USB flash drive to be imaged
- Open Disk Utility
- Click root of USB flash drive
- Click "New Image"
- Select desired Image Format (tested restore of "read-only" and "compressed (bzip2)" images successfully)
- Save image to desired location
Restore
- $ hdiutil convert /path/to/image_created_above.dmg -format UDTO -o new_image.img
- Remove the .cdr extension that hdiutil automatically appended to new_image.img
- Run Disk Arbitrator and set to "Block Mounts"
- Plug in new USB flash drive (WARNING: all contents will be erased) and note the assigned device name in Disk Arbitrator's Disks Window (e.g., diskx)
- $ sudo dd if=/path/to/new_image.img of=/dev/rdiskx bs=8192
(Pipe through pv or use a dd alternative like dcfldd to easily track progress.)
In retrospect, it might've been better to avoid Disk Utility altogether and simply use dd to create the image:
$ sudo dd if=/dev/rdiskx | bzip2 -9f > usb_image.bz2
obviating the need to convert with hdiutil before restoring:
$ bzip2 -dc usb_image.bz2 | sudo dd of=/dev/rdiskx
UPDATE: It appears that dd/bzip2 creates a more faithful image than Disk Utility's compressed (bzip2) format does:
- The image created using dd and bzip2 was 810.7MB vs. 626.6MB for the compressed (bzip2) image created by Disk Utility.
- The MD5 checksum of the USB flash drive differed based on which image file was restored to it, so the difference in file sizes was not merely some difference in the compression algorithm (which should have been the same anyway).
- When the dd-created image was restored and the USB flash drive plugged in, it mimicked the original DiskWarrior flash drive's behavior (only the /Volumes/DW Finder window automatically opened).
- When the Disk Utility-created image was restored and the USB flash drive plugged in, Finder windows automatically opened for both /Volumes/DW and /Volumes/DiskWarrior Recovery (unlike the original DiskWarrior flash drive).
For Disk Utility to achieve similar results as dd/bzip2, one would need to select "entire device" as the Image Format and then compress the image afterwards in Terminal: $ bzip2 -9f usb_image.dmg > compressed_usb_image.bz2. And, before restoring the image, it would need to first be converted with hdiutil as shown above. Back to dd for imaging disks!
/mac | Mar 19, 2015
Subscribe or visit the archives.