Software > OsX86 Hackintosh (Intel / AMD)

restore a multi-partition disk image that disk utility claims is corrupt

(1/1)

chrisNova777:
http://hints.macworld.com/article.php?story=2009041216314856

--- Quote ---Like many others, I used Disk Utility to create a disk image (.dmg) from my full disk, with the expectation that I could restore this backup at a later date. Said date came all too soon, and I found myself accused by Disk Utility of offering it a corrupted image. Much investigation and much research followed: the image was not corrupt, but the graphical tools did not allow a multi-partition .dmg file to be restored, nor did they allow a full-disk .dmg file to be written to a raw disk or a block device.

Luckily for us all, this task is possible! I hope to spare you much of the suffering I experienced with this hint. For this occasional task, the hdid utility is your friend. You must use Terminal, as Disk Utility does not support this use.

First, mount the .dmg file as a block device only:

--- Quote ---hdid -nomount "/Volumes/Diotallevi/Clean Checkpoints/WDC Image.dmg"
--- End quote ---

Second, determine the block device of the image and destination:

--- Quote ---diskutil list
--- End quote ---

Third, use dd with an appropriate buffer size to copy over the whole block image, including partition table and boot sector. Note that it is extremely important on some hardware to use a large block size; you can expect a 20x speedup over the case without blocksize parameter.

--- Quote ---dd if=/dev/disk3 of=/dev/disk2 bs=131072
--- End quote ---

Fourth, unmount everything and enjoy your copied disk. I get around two terabytes a day of transfer rate; I know of no way to skip sparse areas of the disk image, but could approximate it by dding the first few megabytes of the image, then using Apple System Restore to copy each volume individually.
--- End quote ---

Navigation

[0] Message Index

Go to full version