9

Please share, if you know any tips to salvage data from a "compressed DMG" which no longer mounts (in my case, something went wrong during "scan image for restore").

5 Answers 5

8

Answering my own question here with a list of things to try.

  • Disk Utility > First Aid > Repair Disk
  • Disk Utility, try converting the image to an ISO
  • try using 3rd party utility to convert the image, such as "dmg2iso" (sometimes this has a side effect of ignoring corrupt data, and the image will mount)
  • try mounting with 3rd party utility such as Toast
  • hdiutil attach -ignorebadchecksums /Volumes/path/to/image
  • hdiutil mount -nomount -readwrite /Volumes/path/to/image (then try repair using DiskWarrior, etc)

I'll probably be fleshing this list out over the next week as I do more research. I want to take a look through these sites:

8

I found the following command to work on salvaging a corrupted dmg image. The solution started from reading your problem. I looked for a solution for three days.

hdiutil convert imac.dmg -format UDTO -o output.img

Background: I had used diskutil on OSX 10.8.2 to create an image of my iMac's internal drive. I transferred it up to my server and when I went to restore it to another disk it would not mount saying there were no valid file systems. I was devastated as I had too much confidence in the image and got rid of my timemachine images to save space. Okay I am a moron who should know better!

I googled the error and found this discussion. I tried all of the items and was not able to mount the dmg file. I knew the the image was basically good by running

hdiutil imageinfo imac.dmg which gave promising results:

Format Description: UDIF read-only compressed (zlib)
Class Name: CUDIFDiskImage
Checksum Type: CRC32

From a link provided in this thread http://discussions.apple.com/thread.jspa?threadID=1218394

I found a reference to http://vu1tur.eu.org/tools/ for dmg2img which DMG2IMG is an Apple's compressed dmg to standard (hfsplus) image disk file convert tool. I went to the read me file for the tool which had this note:

1. An equivalent command under Mac OS X would be:
    hdiutil convert <input.dmg> -format UDTO -o <output.img>

And that turned out to be the solution. I was able to mount the output file, which was the right size, 200GB, and extract the files I needed!

SUCCESS!

3
  • Brilliant; got the same issue (curse you, OSX Disk Utility restore feature...); after the conversion I was able to get the image and restore it. I suspect my image was compressed, since it end up being twice as big as the original DMG file.
    – rataplan
    Nov 27, 2014 at 2:52
  • 1
    Can confirm this solution still works, tried on MacOS 15.4. FWIW, lots of other answers suggest hdiutil attach, but only convert worked for me.
    – Hayek
    Apr 22, 2020 at 5:24
  • This worked for me as well, on am m1 mac in 2022. I don't know why it works, but it worked. Seems like it must be some kind of bug…
    – donatJ
    Dec 28, 2022 at 7:46
3

I had to use the -noverify and -mount suppressed flags to get my disk to mount. Without those flags, the errors kept causing the mount to abort. After mounting in this way, I was able to select a blank entry in the Disk Warrior drop-down and recover the majority of my files.

hdiutil attach -noverify -mount suppressed /Volumes/path/to/image
1

DiskWarrior can be used to rebuild some corrupt disk images, depending on the nature of the corruption. Might be worth a shot if you have a copy.

-2

Most probably, it is dead beyond repair.

You will need to download or obtain it again.

1
  • 1
    How can you tell that is broken beyond repair? I had the same issue and converting the image fixed the issue. An attempt is always a good thing to do, before give up :)
    – rataplan
    Nov 27, 2014 at 2:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .