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.

This comes up pretty regularly for me, so I decided to record the details here:
If you need more details, just type

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
Post a Comment