I had some video I captured with iMovie sitting on an external Firewire drive for a little while. That drive was getting full and I needed to clear off some space by moving some of those iMovie projects to DVD. The problem was, one of those projects was 5.38GB, larger than what a DVD can hold. I needed some way to either compress it down or break it up so that it could fit on a single DVD or span multiple discs.
First, I compressed the project using gzip and bzip2 from the command line. Neither utility compressed the video very much, and neither compressed it to a size that would burn onto a single DVD. Enter hdiutil! (The command line analog to Disk Utility.)
As you may know, hdiutil has the ability to compress and segment disk images. I decided to do both of those things and share it here with you, with a couple of additions.
Compressing 5.38GB of data and copying it to a disk image took me some time - 198 minutes. I know that because I used a neat little utility called, appropriately enough, time, whose job it is to print the real time it took a process to complete, the user CPU time, and the system CPU time, at process completion. In this case, time didn’t have any substantive effect on what I did except to satisfy my curiosity. I figured I’d mention it here for your edification.
When a process takes 198 minutes, you may not be at the computer physically or even logged in for that long. You’ll need a way to put that process in the background just in case. That’s where screen comes in. It detaches running processes from a physical terminal (AKA the Terminal application) and lets the user logout and return later while the work you’ve started continues running.
As for the disk image itself, I made a compressed image from a folder. Take a look at this command:
screen -a time hdiutil create -srcfolder /Volumes/Video/Dogs/ -fs HFS+ -volname "The Dogs" -format UDBZ -verbose Desktop/temp.dmg
Wow, that’s a bunch. Here’s the breakdown:
screen -a
|
creates the virtual terminal with the proper abilities for disk image creation. |
time
|
keeps track of the time taken for the job, as mentioned above. |
hdiutil
|
is the command line disk image creator. |
create
|
tells hdiutil we’re creating an image. |
-srcfolder /Volumes/Video/Dogs/
|
sets that path on the external drive to be the source for the image. |
-fs HFS+
|
sets the filesystem for the image as HFS+, Mac OS X’s native filesystem. |
-volname "The Dogs"
|
sets the name of the volume when it’s mounted. In this case, since it’s video of my two puppies, I named it appropriately. |
-format UDBZ
|
filters the image through the bzip2 compression engine. The good part about this is that the image will be smaller than if we left things at the default and didn’t specify a UDBZ format. The bad is that compression probably significantly increases image creation time, and this particular image type is specific to Tiger. It won’t work on previous OS X versions, but will almost certainly be supported in Leopard and subsequent versions of Mac OS. |
-verbose
|
prints all the details of the image creation as they happen. |
Desktop/temp.dmg
|
specifies the output image. |
Why did I name the output image temp.dmg? Because after this image is created, we need to segment it, which means writing two new segmented image files while leaving the original intact.
I said screen provided the ability to leave the process running while the user is logged out. Should you need to leave during a multi-hour compression and creation, press control-a and then d afterwards to disconnect. You’ll be returned to the original prompt you started from while hdiutil keeps running. To resume, type screen -r at any time from any command prompt. Should hdiutil finish compressing and creating the image while you’re away, screen will terminate on its own and there will be no session to resume.
After I grew a long white beard, the image was ready. Now it needed to be segmented.
hdiutil segment -o Desktop/Dogs.dmg -segmentSize 4.37g Desktop/temp.dmg
hdiutil
|
still means the same thing. |
segment
|
tells hdiutil we’re going to split up an existing image. |
-o Desktop/Dogs.dmg
|
sets the path and name for the segmented image file we’re creating. |
-segmentSize 4.37g
|
specifies that the size of each segment shouldn’t exceed 4.37GB, the amount of data that will fit on a DVD-R. |
Desktop/temp.dmg
|
specifies the source image that we’re going to chop up. |
In this case, I ended up with files named Dogs.dmg and Dogs.002.dmgpart. Double-clicking Dogs.dmg mounted the image on the desktop. To mount them in the future, should I need them, I’ll copy both parts to a hard drive and mount it from there rather than from the DVDs.

My .Mac Web Gallery
October 25th, 2005 at 1:58 am
That is thoroughly impressive. I could never recreate these steps, despite the great instruction, though.
February 24th, 2006 at 8:02 am
Thanks Aaron- great tip. I had seen the results of this being done before and wondered how they did it.
Even though it’s a pain, I will typically create a zip file (create archive) (or not if it’s already compressed data like video or JPEG, etc). Then I’ll segment it using split and concat into something like 100-300MB chunks. Then I’ll use this wonderful utility, PAR2, which comes in various incarnations (I use the commandline version, which can either be stripped out of MacParDeluxe or from SourceForge) to create par2 files. These do not only error detection, but error correction on a block by block basis. Originally intended for those flaky Usenet binary transfers, it works great for me by compensating for media flaws, scratches, etc and just general peace of mind. In a nutshell, it does parity (like RAID5) correction, but much more sophisiticated. Very cool!
This can be done for disk images, iMovie projects, or just really long .dv captures from my DV camcorder.
- Troye Welch
February 24th, 2006 at 10:40 am
I believe Apple used to distribute their ADC disk images as segments this way.
Good tip about PAR2, split, and concat. There are apparently several ways to split up giant files, and having options is almost always good.
December 3rd, 2006 at 6:00 pm
it must be fun to have know-hoe to do such things with a computer-
however for this 78yr.old bloke it is just too much . Can you please reccomend a program that will do this (on a p/c -not mac) as i have a movie file of approx 14Gbs and wish to span it across two or more DVD’s . regards bob
December 4th, 2006 at 8:25 am
Great! I’m trying this on a 10GB project now…if it works, I will do for a 26GB one next!
December 11th, 2006 at 5:21 pm
Worked like a dream - now I can get those pesky large projects of my drive
January 1st, 2007 at 8:15 pm
I found a freeware little program that let’s you split and make dmg and dmgpart files out of a big folder in mac os x (I think only for 10.3.8 or higher). It’s called Imagelt (find it in the software section of the apple website). It works well, but it is slow. I will try the instructions above using hdiutil to see if it takes less time
September 9th, 2008 at 12:40 am
Yep, still works under Leopard. The manpage gives hope for the future too:
UDCO - UDIF ADC-compressed image
UDZO - UDIF zlib-compressed image
UDBZ - UDIF bzip2-compressed image (OS X 10.4+ only)