Splitting DMG files into smaller segments

There are a number of tools which can split files, some free some not. However the versions I have tried seem rather hit or miss. Most people don’t relise that OSX can split DMG files without any 3rd party applications. You do however need to use Terminal (Applications > Utilities > Terminal) rather than an a pretty GUI.

The tool in question is called hdiutil, this allows you to attach, detach (eject), verify, mount, unmount and segment plus much more. Typing hdiutil help in to Terminal will display a help guide which is worth a look.

To segment a DMG file enter the following:

hdiutil segment -o mysplitimage -segmentSize 100M /Users/[your Mac username]/Desktop/myimage.dmg

This will create segments (mysplitimage.002.dmgpart, mysplitimage.003.dmgpart, etc.) in your Home folder of an image named myimage.dmg on your desktop.

-o specifies the name of the segments

100M specifies the segment size (K and KB can also be used)

It is also possible to specify the number of segments rather than size. Just replace -segmentSize with -segmentCount followed by the number.

It is not neccessary to rejoin the segments. Clicking the the first segment will mount the DMG in the same way as before the split.