DiskImage Hacks on Mac OS X

ziggy on 2004-02-14T04:18:15

I downloaded the XCode 1.1 CD image from the Apple website tonight. It's about 600MB, split into 20-something parts, and binhex'ed. Un-binhexing the parts leaves a .dmg, split into 20-something parts.

Double click on the first segment, and the disk mounting tool will find all segments and mount the disk image. It. Just. Works. (tm)

...but it's a little annoying keeping 20-odd 23MB files around when I could keep around a single-file disk image. hdiutil to the rescue:

hdiutil segment -o ../Xcode_Tools_1.1.dmg \
      -segmentCount 1 Xcode_Tools_1.1.dmg
To go the other way, use hdiutil segment with a -segmentSize param, or specify more than one segment to split into. Good for splitting a multi-gigabyte .dmg archive of, say, $HOME into CD-sized chunks. ;-)