4

I want to convert an .iso to .dmg, how can I do this from Terminal?

nohillside
  • 100,768
bomben
  • 1,083

1 Answers1

6

OS X has hdiutil, a command line tool for making, manipulating and using disk images with an option to convert between different types of images.1

To do this use the command with verb convert and option -format.

Option -o is used to specify the path and name of the output file.

There are several formats available from which I post two for .DMG and one for .ISO:

  UDRW - UDIF read/write image
  UDRO - UDIF read-only image
  UDTO - DVD/CD-R master for export

Use the first one for a read/write-able .DMG. The resulting command is:

hdiutil convert /path/file.iso -format UDRW -o /path/file.dmg

The backward conversion would be done by

hdiutil convert /path/file.dmg -format UDTO -o /path/file.iso
bomben
  • 1,083
  • Here's a nice use case for the opposite direction - Mac installers are DMG and some software wants an ISO (VMware / Parallels / etc...) - http://apple.stackexchange.com/questions/278336/generalizable-gude-to-convert-dmg-to-iso-bootable-for-lion-to-sierra – bmike Apr 01 '17 at 17:43