Recent | Online | Vintage | Modern | Win | Mac  OS9 | DOS | Amiga | Atari ST | Graphics | Midi io | Sequencers | Roland "MC" | E-mu | Ensoniq | Akai MPCs | Samplers | Akai "S" | Roland "S"Synths | VST Samplers | VST Synths | Roland "JV" | Modules | Drums | Mixers | Timeline | HackintoshArtists | Graphics

Welcome to Oldschooldaw.com! (Online since 2014) proudly SSL-FREE! and serving vintage computers worldwide! if you are human, Register & Login to gain more access to all boards here; Some guest permissions have been limited to reduce traffic from bots and encourage registration. This website serves as a home base for any and all peoples who are interested in the topics posted here which is mostly very technical references + resources to do with music production on various home computer operating systems. If you have any information that is relevant, we'd love to have you take the initiative to contribute!

Author Topic: restore a multi-partition disk image that disk utility claims is corrupt  (Read 2246 times)

0 Members and 1 Guest are viewing this topic.

Offline chrisNova777

  • Underground tech support agent
  • Administrator
  • Posts: 9847
  • Gender: Male
  • "Vintage MIDI Sequencing + Audio Production"
    • www.oldschooldaw.com | vintage audio production software + hardware info
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"

Second, determine the block device of the image and destination:
Quote
diskutil list

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

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.