"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

  1. Insert USB flash drive to be imaged
  2. Open Disk Utility
  3. Click root of USB flash drive
  4. Click "New Image"
  5. Select desired Image Format (tested restore of "read-only" and "compressed (bzip2)" images successfully)
  6. Save image to desired location

Restore

  1. $ hdiutil convert /path/to/image_created_above.dmg -format UDTO -o new_image.img
  2. Remove the .cdr extension that hdiutil automatically appended to new_image.img
  3. Run Disk Arbitrator and set to "Block Mounts"
  4. 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)
  5. $ 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:

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.