Create Small Disk Image on OSX

One of the strangest things about the builtin Disk Utility app on OSX is that it has a minimum size when creating a disk image. Notice in the screenshot below how I’m not allowed to create an image smaller than 40 MB? The strange thing is that this is a limitation applied by the UI, not by the system. hdiutil will happily generate a .dmg file that’s smaller if I use the command line to do it.
Disk Utility
This comes up pretty regularly for me, so I decided to record the details here:
hdiutil create -size 920k image.dmg -srcfolder blah/ -fs HFS+
The -srcfolder option isn’t necessary but it’s kind of cool. It will create your disk image with the files from -srcfolder already inside. Neat, huh?
If you need more details, just type hdiutil to get a list of options.

Comments

Popular posts from this blog

FREE Delphi Starter Edition

Getting Homebrew Set Up For Non-Admin Account on Your Mac OSX 10.8

Mono Versions in Unity 3.5.7 and 4.3.4