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

Is there a way to further compress a disk image file created by the disk utility program on macs? I need to fit a 6.5G/5.5G image onto a 4.7G disk.

share|improve this question
You might consider getting dual-layer DVD-R[W?] media, too: if the disk image is already in a compressed form, you're not likely to get the requested ~30% reduction – warren Oct 27 '09 at 7:50

The Disk Image - is it currently compressed already and if so, did you use the default offered by Disk Utility? You can find out in Disk Utility or by running hdiutil imageinfo /PATH/To/DMG | grep 'Format'. The different formats you may see (more at man hdiutil):

UDRW - UDIF read/write image
UDRO - UDIF read-only image
UDCO - UDIF ADC-compressed image
UDZO - UDIF zlib-compressed image
UDBZ - UDIF bzip2-compressed image (OS X 10.4+ only)
UFBI - UDIF entire image with MD5 checksum
UDTO - DVD/CD-R master for export
UDSP - SPARSE (grows with content)
UDSB - SPARSEBUNDLE (grows with content; bundle-backed)

By default Mac OS X will use UDRW for a standard read/write image, UDRO for a read only image and UDZO for an image made using Disk Utility that was chosen as compressed.

In terms of compatibility and file size of the compressed option ADC gives you the worst compression but is compatible all the way back to 10.0, zlib compression back to 10.1 whereas bzip2 is much smaller it takes longer to create and longer to uncompress and requires Mac OS X 10.4 or newer. Well, except the default compression algorithm in 10.6 seems to work better than UDBZ. The Lion installer disk image compresses down more with the default compression algorithm than it does if converted to UDBZ!

I would suggest changing the compression to bzip2 and see how much space that saves you. That said if it's a disk image of images and videos it won't save you much space as the files in question are already compressed. To change the compression to bzip2 and create a new bzip2 compressed disk image you can run the following command:

hdiutil convert /PATH/TO/IMAGE.dmg -format UDBZ -o /PATH/TO/NEW/IMAGE.dmg

If you want a GUI for making bzip2 disk images or more I suggest taking a look at other .dmg creation products such as DropDMG

share|improve this answer
+1 nice answer, very useful – quack quixote Oct 25 '09 at 17:20
This answer should be accepted. – Rivera Apr 20 at 12:41

When you perform a Get Info on the original folder or disk, how big is it? What's the current compression ratio?

Chances are you could ZIP or RAR it, and get 3% - 5% compression... But is it really worth it? You'll spend an additional half hour, to hour attempting to compress already compressed data.

1) Try to create a sparse bundle that contains your information, and see if that is any smaller... 2) Does it have to be a disk image? If you have a target size, would ZIPing or RARing that data work better?

share|improve this answer
Also try zip or rar forst might get more compression but I doubt by the amount you want – Mark Oct 25 '09 at 14:00

Probably wouldn't gain much by compressing twice. Make a new image with less data in it, or use a file splitter to put it on two disks instead of one, and reassemble later.

share|improve this answer

You must log in to answer this question.

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