Edit Any DMG Image

It is quite easy to edit a DMG image.

To modify a DMG first mount the image in "read/write" mode (with shadow option), then when finished editing the DMG convert/copy the changes made inside the shadow copy into another DMG. Super easy!

Open the DMG R/W With Shadow

  • Open Terminal.app and mount the image with the shadow option
hdiutil attach -owners on Original.dmg -shadow
  • Edit the DMG contents, when finished editing unmount the image
hdiutil detach /dev/disk#

Where # is the image's disk number (use: diskutil list to list them all)

  • Now convert the shadow to a new DMG
hdiutil convert -format UDZO -o The_Edited.dmg Original.dmg -shadow

Output Formats

These are the image output formats you can choose from:

UDRWUDIF read/write image
UDROUDIF read-only image
UDCOUDIF ADC-compressed image
UDZOUDIF zlib-compressed image
ULFOUDIF lzfse-compressed image (OS X 10.11+ only)
UDBZUDIF bzip2-compressed image (Mac OS X 10.4+ only)
UDTODVD/CD-R master for export
UDSPSPARSE (grows with content)
UDSBSPARSEBUNDLE (grows with content; bundle-backed)
UFBIUDIF entire image with MD5 checksum
UDROUDIF read-only (obsolete format)
UDCOUDIF compressed (obsolete format)
RDWRNDIF read/write image (deprecated)
RDXXNDIF read-only image (Disk Copy 6.3.3 format;
ROCONDIF compressed image (deprecated)
RKENNDIF compressed (obsolete format)
DC42Disk Copy 4.2 image (obsolete format)
{{ message }}

{{ 'Comments are closed.' | trans }}