|One of the hidden gems of the Macintosh administrator's toolbox is hdiutil. Why?|
One of the interesting things that can be done with hdiutil is attaching a read-only image using a shadow file. Here's how:
First, attach the read-only image as with the shadow option:
hdiutil attach -owners on your.dmg -shadow
After typing this command, the image will be attached as a new device to your operating system. Usually this is shown from the command line.
Next, copy over any items, or modify anything on the read-only image. Detach the image when finished:
hdiutil detach /dev/disk#
Almost done! Now, convert the image back to read-only
hdiutil convert -format UDZO -o new.dmg your.dmg -shadow
Guess, what you now have a brand new dmg, and the time and space required to convert the image to read-write has been eliminated.