5

Okay, so I have a .dmg file I want to convert to .img It's stored in my home directory so I type:

dmg2img image.dmg image.img

(The image is actually called image)

Then I get:

caitlan@caitlan-iMac:~$ dmg2img image.dmg image.img

dmg2img v1.6.2 is derived from dmg2iso by vu1tur (to@vu1tur.eu.org)

ERROR: dmg image is corrupted

What can I do? Can I fix this? Could I use a different program to do the conversion? I'm 90% sure the image isn't corrupted

Braiam
  • 67,791
  • 32
  • 179
  • 269

2 Answers2

1

I came upon this issue recently, and found a workaround. Posting it here, for anyone else who has this problem.

As it so happens, for some use cases, dmg = img. For example, if you want to write a MacOS installer dmg to a USB drive, in Linux, you can do this:

dd if=image.dmg of=/dev/myusbdrive

(Replace "myusbdrive" with the device name of your USB drive, such as "sde".)

If all you want to do is change the file extension, you can just move/rename it:

mv image.dmg image.img

With both of these methods, the partition schema and filesystems of the new image or device will be the same as the old image or device (GPT partition table with a single HFS+ filesystem, for example).

I know that this doesn't directly address how to get dmg2img working (it seems to be a bug), but hopefully, this will help someone out of a bind, in the future.

DaneM
  • 376
0

the image may be password-protected. If this is the case I don't know if img2dmg is able to handle the situation.