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.

1 Answer 1

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.

  • What if I don't care about the type of compression? Or must I match the compression of the existing DMG? +1 and thanks Feb 17, 2012 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. Feb 17, 2012 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.