Macos – Write to .dmg file on Mac OS X 10.6.4

dmg-imagemacososx-snow-leopardpermissions

Following steps to update a .dmg file (mounting and Show Contents), I'm unable to write to the folders in the DMG file.

Doing a "Get Info" displays a locked padlock and all else greyed out in the Sharing & Permissions section. Clicking on the padlock and entering my password does unlock the padlock but the Sharing & Permissions is still greyed out. It does show I have Read & Write and "You have custom access" (greyed out) but am not able to copy files into the contents of the DMG.

Any hints? Thanks.

Best Answer

Most .dmg files are read-only. A common workaround is to copy the contents of a mounted .dmg to a folder on your hard drive, and making your edits on that copy.

If for some reason that workaround won't work for you (not enough free disk space perhaps?), you can mount a read-only disk image with a "shadow file" to make it act writable. All writes are actually written to the shadow file instead of the original read-only .dmg, which is left untouched.

hdiutil attach -shadow filename.shadow filename.dmg
Related Question