Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 3 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 –  Yar 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! –  Yar Feb 22 '12 at 0:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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