You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Trying to recover the contents of a DMG which fails to mount with “Corrupt Image”

So about a week ago I used the disk Utility to make a few images of some folders in my MacBook pro as a backup (1 small with docs, one about 3GB with miscellaneous stuff and 1 about 96 GB full of photos, jpg and raw). After they were successful and mounted. I put them in an external SSD and formatted my Mac... 

Today I try to get some of those into my newly formatted Mac and surprise, the two big images cannot be mounted because they are corrupted.

I attempted to use the Disk Utility to either analyse, convert or resize and it also complains about the image being corrupted.


  • extracting DMG using 7Zip - not working
  • converting it to another format like ISO - not converting
  • opening DMG using Disk Drill - not opening
  • opening DMG using Data Rescue - not opening

Is there any way to extract the data from the corrupted DMG file?


I believe there will be a way to breaking this dmg file because it still have 96 GB data, just not able to open it. Without using any recovery software will I be able to open this file. Help will be greatly appreciated.

Attaching screen shots.

MacBook Pro 13″, macOS 10.15

Posted on Jun 6, 2020 5:01 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 6, 2020 6:15 PM

Are you using the same or newer version of macOS which created the .dmg files?


Make another copy of your corrupted .dmg file. You always want to work on a copy instead of the original in case you make a mistake and the problem gets worse. This way the original file remains untouched.


Then see if you can use TestDisk to access the copy of the .dmg file.


You may want to try using the Terminal command line utility "hdiutil" to manually attach the .dmg file. I haven't used this utility enough to know the best way to utilize it for this situation. If "hditutil" works, then it may be possible to use Disk Utility or "diskutil" to try and repair the .dmg as long as it isn't read-only.


Another option would be to try and open a copy of the .dmg file using Linux. You will need to convert the .dmg file to a standard .img file using the Linux utility "dmg2img" before attempting to access the resulting .img file using "losetup" and using "mount" to mount the volume.


The most expensive option would be to contact a professional data recovery service such as Drive Savers or Ontrack to see if they can access the corrupted .dmg files. Both vendors provide free estimates and both are recommended by Apple.


While I commend you for making sure to test the image files you need to do the testing after you move them to the final destination (I know this is easy to overlook). Also you should have regular & frequent and verified working system backups (at least two different backups are recommended).


Similar questions

5 replies
Question marked as Top-ranking reply

Jun 6, 2020 6:15 PM in response to mnvr

Are you using the same or newer version of macOS which created the .dmg files?


Make another copy of your corrupted .dmg file. You always want to work on a copy instead of the original in case you make a mistake and the problem gets worse. This way the original file remains untouched.


Then see if you can use TestDisk to access the copy of the .dmg file.


You may want to try using the Terminal command line utility "hdiutil" to manually attach the .dmg file. I haven't used this utility enough to know the best way to utilize it for this situation. If "hditutil" works, then it may be possible to use Disk Utility or "diskutil" to try and repair the .dmg as long as it isn't read-only.


Another option would be to try and open a copy of the .dmg file using Linux. You will need to convert the .dmg file to a standard .img file using the Linux utility "dmg2img" before attempting to access the resulting .img file using "losetup" and using "mount" to mount the volume.


The most expensive option would be to contact a professional data recovery service such as Drive Savers or Ontrack to see if they can access the corrupted .dmg files. Both vendors provide free estimates and both are recommended by Apple.


While I commend you for making sure to test the image files you need to do the testing after you move them to the final destination (I know this is easy to overlook). Also you should have regular & frequent and verified working system backups (at least two different backups are recommended).


Jun 10, 2020 2:42 PM in response to HWTech

Hello HWTech


Thanks for your response. my response below.

I'm using the same version of macOS. I'm not able to install TestDisk you've mentioned. Can you help me with that also with terminal command hditutil/hdiutil/diskutil I didn't get these, can you explain me elaborately; as I'm a amateur.

Thank you in inadvance


Jun 10, 2020 9:43 PM in response to mnvr

I haven't used the "hdiutil" or "diskutil" or other macOS specific commands very often and only in the most basic ways. This is not easy to describe because so much depends on the actual error messages you may receive. Plus I'm not real familiar with the macOS utilities so I would need to do a lot of research and experimentation to do more than provide the basics to get you started and point you in the right direction:


You use "hdiutil" to "attach" an image file so that macOS utilities can manipulate the image contents. Using the Terminal app type the following making sure to leave at least one space at the end of the line:

hdiutil  attach  


Now drag & drop your .dmg file from the Finder onto the Terminal window to auto-fill the correct path to your .dmg file. Then within the Terminal app press the "Return" key to execute the command. If successful you may try to mount it read only.


To try and mount the attached .dmg using the command line I think it is easiest to use "diskutil" since the "mount" command needs to be provided a lot more information.

diskutil  mount  readonly  <path-to-attached-dmg-file>


or if you know the disk identifier for the attached .dmg file (replace the "diskXsY" with the correct drive identifier for your attached volume):

diskutil  mount  readonly diskXsY



If the file system within the .dmg is damaged you may be able to run "fsck" on it to repair the file system contained in the .dmg file assuming it is a writable image. If it is not a writable image, then you need to convert it to a read+write image.


If the image is writable you can try repairing its file system using "fsck". If you can find the path or identifier for the attached .dmg file add it to the following command in place of "<path-to-attached-dmg-file>":

sudo fsck  <path-to-attached-dmg-file>


Or use the disk identifier if known (again replacing "diskXsY" in the example):

sudo  fsck  /dev/diskXsY


Also "hdiutil attach" has a lot of options which may help you. You can review the command options of any command by typing "man " followed by the name of the command you want help with. For example to find out which options are available for "hdiutil" you would do this:

man  hdiutil


Use the arrow keys or the mouse/trackpad to scroll up & down. To exit the "man page" just press "q".


I don't know if the paid app Disk Warrior would be able to work on a .dmg file or not. The image would need to be in a read+write format though.


Another option would be trying to using Linux and the Linux command line tools to access these .dmg files. It is possible they may be able to work around some minor issues. Linux typically is more forgiving when trying to open damaged items. I do know that the .dmg files will first need to be converted to a standard raw image format using the Linux utility "dmg2img". Then you would use "losetup" which is the Linux equivalent of "hdiutil" to access any partitions within the image before mounting it. Linux also has access to TestDisk.


I've only presented the very basics here. Basically a .dmg file is just a raw image file usually containing a file system whose contents are compressed. Except for being contained in a file you can almost think of it like an external drive if that helps. While I've done similar things on Linux a few times over the years it is not second nature to me yet and I will sometimes need to Google how to perform some of these steps myself. Just make sure to work from a copy of the .dmg file so you always have the original file in its original state. Also macOS can get stuck when attaching, detaching, mounting, and unmounting volumes and virtual volumes. Many times I will see the Finder showing volumes which I unmounted. If you see these phantom/ghost volumes, then you may find that you need to reboot the computer to get Finder and Disk Utility to act normal again.

If this is overwhelming and you don't have the time which is perfectly understandable, then I suggest contacting a professional data recovery service and get an estimate. Unfortunately most technical computer users are not familiar with these procedures and trying to find good & accurate information on it for macOS is extremely difficult. There isn't even a whole lot of information for doing this on Linux either.


Good luck.

Jun 11, 2020 9:42 AM in response to mnvr

That isn't good since any macOS utility would need at least this very basic step especially since you cannot run TestDisk on Catalina.


The only things I can suggest is to try using TestDisk while booted from an earlier version of macOS. Or boot from a Knoppix Linux USB drive to try and convert the .dmg file to a standard raw image file where maybe the Linux utilities could then mount it. I don't recall if Knoppix includes the "dmg2img" utility by default or if it would need to be installed. Linux doesn't write to HFS+ (Journaled) or APFS volumes so the file would need to be stored on a volume without the Journaled HFS+ file system. An HFF/HFS+ file system on an external drive with the Journal disabled is sufficient. Linux can read from an HFS+ (Journaled) volume, but it cannot safely write to it. Once the .dmg file is converted TestDisk (available with Knoppix) may be able to access the contents.


I don't know if any of the other macOS data recovery apps can work from a .dmg image file, but it may be worth checking out since most of them offer a free demo.


Otherwise contacting a professional data recovery service is your only other option.

Trying to recover the contents of a DMG which fails to mount with “Corrupt Image”

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.