Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is information on how to do the opposite (which is hard to impossible), but how do I make a writeable DMG readonly?

The reason that I might want to do this -- because otherwise this question is too short and will not meet superuser quality standards -- is that I am distributing a DMG and I don't want it altered TOO easily.

share|improve this question
up vote 4 down vote accepted
hdiutil convert /path/to/rwimage.dmg -format UDRO -o /path/to/readonlyimage.dmg

There are a number of other format options (with e.g. various kinds of compression); see the hdiutil man page for details.

share|improve this answer
What if I don't care about the type of compression? Or must I match the compression of the existing DMG? +1 and thanks – Dan Rosenstark Feb 17 '12 at 7:51
Apple seems to regard zlib compression (-format UDZO) as the "default", so I'd go with that. There's no need to match the existing compression, especially since RW images aren't stored compressed. – Gordon Davisson Feb 17 '12 at 15:22
Awesome stuff, thanks! – Dan Rosenstark Feb 22 '12 at 0:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .