Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Burn OS X Mountain Lion installer to single-layer DVD System 10.8
If you've tried burning the Mountain Lion installer to a standard DVD, you've probably noticed that it does not quite fit. Fortunately, there is a way around this.

The problem is that the size of the InstallESD image is fixed at 4.75 GB; slightly larger then a 4.7 GB single-layer DVD. However, the actual contents of the image occupy only 4.38 GB on disk, which will fit on a standard DVD.

In order to cram Mountain Lion onto a standard DVD, we need create a slightly smaller image file of the exact same format, copy the contents over, then burn it to a DVD.

I've written a small script to make this process quick and easy. Simply paste the code below into a plain text document and save it with a file extension of ".sh" To run the script, fire up Terminal and enter "bash /path/to/script.sh". When this script finishes, you will have a new, smaller DVD image in your home folder, ready for burning.

NOTE: This script assumes you have the "Install OS X Mountain Lion" application in /Applications. It won't work if it's located elsewhere. You'll also want to make sure you have at least 9 GB of disk space free, as the script temporarily creates two additional copies of the install image.
#! /bin/bash

rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg # Remove any old copies of the DVD image before we begin.

echo "Creating DVD Image..."
hdiutil create -size 4.2g -volname "Mac OS X Install ESD" /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -fs HFS+ -layout SPUD

# hdiutil attach -nobrowse /Applications/Install\ OS\ X\ Mountain\ Lion.app/Contents/SharedSupport/InstallESD.dmg
hdiutil attach -nobrowse ~/Desktop/InstallESD.dmg 
hdiutil attach -nobrowse /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Copying Mountain Lion to new image..."
cp -pRv /Volumes/Mac\ OS\ X\ Install\ ESD/* /Volumes/Mac\ OS\ X\ Install\ ESD\ 1/

hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD\ 1
hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD

echo "Converting to read-only..."
hdiutil convert /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -format UDZO -o ~/Desktop/Mountain\ Lion\ DVD\ Image.dmg

rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Image Creation Complete. Please burn '~/Desktop/Mountain Lion DVD Image.dmg' to a DVD using Disk Utility."
open ~/Desktop/
[kirkmc adds: I haven't tested this. Given the cost of USB sticks, and the fact that, if you do want an installer, it's better to have the most recent one, I've gone that route using Lion DiskMaker. Some people may prefer DVDs, but another factor is whether or not your Mac has an internal DVD drive; my Macs - a Mac mini and a MacBook Pro - do not, so USB is easier than using an external drive. Note: I've updated the script in the hint to the last revision below in the comments as of 8/18/12.]
    •    
  • Currently 4.29 / 5
  You rated: 5 / 5 (7 votes cast)
 
[45,860 views]  

Burn OS X Mountain Lion installer to single-layer DVD | 21 comments | Create New Account
Click here to return to the 'Burn OS X Mountain Lion installer to single-layer DVD ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: Typhoon14 on Aug 07, '12 09:26:20AM

Hint author here. I'll agree that in most cases you would be better off using a USB flash drive (8 gig drives cost practically nothing these days.) In my case, my employer asked that I create some bootable DVDs, and I didn't want to have to order a bunch of dual-layers. I'm sure there are others in similar circumstances.



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: vsilves on Aug 07, '12 10:17:21AM

I haven't tried the script, but it probably won't work in bash without properly escaping and/or quoting the paths with spaces on them.



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: Typhoon14 on Aug 07, '12 12:11:01PM

You're absolutely right - good catch. The paths were fully escaped when I submitted the hint, but it looks like the backslashes got stripped out after submission.

I'll see about getting it fixed. In the meantime, you can download the escaped version here:
https://dl.dropbox.com/u/10577704/create-mountain-lion-dvd.zip



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: kirkmc on Aug 07, '12 12:52:33PM

I've fixed it.

---
Mac OS X Hints editor - Macworld senior contributor
http://www.mcelhearn.com



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: DCJ001 on Aug 07, '12 01:20:27PM

Typhoon14 said:

"but it looks like the backslashes got stripped out after submission."

Were they back slashes, or forward slashes?



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: idontwanttoregis on Aug 07, '12 05:36:23PM

404 Error, please fix!

Thanks



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: Typhoon14 on Aug 07, '12 12:17:21PM

deleted

Edited on Aug 07, '12 12:53:58PM by Typhoon14



[ Reply to This | # ]
Burn OS X Mountain Lion installer -revised script
Authored by: prwiding on Aug 07, '12 12:32:37PM
The shell script does require some modification. I have copied my version of the script below.

I had the install app in a Downloads folder. You will need to change that reference to where your copy of the app is located.


#! /bin/bash
#  2012-08-07  01  prw  from Mac OS X Hints web site...
#                       added backslash before spaces in image names...
#                       Should be run on /Volumes/Scar not on the SSD
#  2012-08-07  02  prw  References are all relative, not absolute. So SSD it is.

# Remove any old copies of the DVD image before we begin.
rm -f /private/tmp/Mountain Lion DVD Image read-write.dmg

echo "Creating DVD Image..."
hdiutil create -size 4.2g -volname "Mac OS X Install ESD" \
/private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -fs HFS+ -layout SPUD

hdiutil attach -nobrowse \
/Volumes/Scar/Users/prw/Downloads/Install\ OS\ X\ Mountain\ Lion.app/Contents/SharedSupport/InstallESD.dmg
hdiutil attach -nobrowse /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Copying Mountain Lion to new image..."
cp -pRv /Volumes/Mac\ OS\ X\ Install\ ESD/* /Volumes/Mac\ OS\ X\ Install\ ESD\ 1/

hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD\ 1
hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD

echo "Converting to read-only..."
hdiutil convert /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg \
-format UDZO -o ~/Mountain\ Lion\ DVD\ Image.dmg

rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Image Creation Complete. Please burn '~/Mountain Lion DVD Image.dmg' to a DVD using Disk Utility."
open ~/
#-----------------------------------------------------------------------------------------------------------
This ran in Terminal, after I saved the text as "MLresize.sh", using nano, and ran
    chmod 755 MLresize.sh   
on the file.

(I've got a lot of blank DVDs. And they won't get zapped by lightning like my Base Station did.)

The script ran in a few minutes, much less time than actually burning the DVD.
I just dropped the created .dmg file into Disk Utility, selected it, and clicked on burn.
After burning, the disc shows in System Preferences->Startup Disk as bootable.
Although I haven't tried it out yet.

[ Reply to This | # ]

Burn OS X Mountain Lion installer to single-layer DVD
Authored by: richard2 on Aug 07, '12 02:24:48PM

How exactly does this work? How can you reduce the uncompressed size of an image without losing any data?



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: Typhoon14 on Aug 08, '12 01:56:27PM

The image itself has a fixed size of 4.75 GB, but contains only 4.35 GB of data. All we're doing is trimming the free space.



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: macsrwe on Aug 07, '12 03:32:50PM

So you can't just use Image/Resize in Disk Utility? (I'd try it, but I don't have Mountain Lion.)



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: Typhoon14 on Aug 08, '12 01:54:23PM

Resize only works for read/write disk images, so, no.



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: Aguilla on Aug 07, '12 04:18:03PM

I just copy/pasted the stuff for terminal, not bothering with the bash and everything worked as advertised. Verifying burnt disc now. Thanks!!



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: derekJAB on Aug 08, '12 07:09:13AM

@kirkmc Why do you need Lion DiskMaker? Can't you just restore the InstallESD image in Install X Mountain Lion/Contents/SharedSupport using Disk Utility?

I have an installer on a USB and an SDHC Card using the restore method.

Edited on Aug 08, '12 07:10:05AM by derekJAB



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: babaloo on Aug 08, '12 02:53:23PM

@derekJAB,

you can in fact restore InstallESD.dmg. Just remember to mount the dmg for Mountain Lion.
If you don't, disk utility will throw you an error.



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: ptujec on Aug 09, '12 02:11:22AM
So I already deleted the Install thing in applications. I copied the InstallESD.dmg image to my desktop (cause I like to keep things on my desktop) and changed the script accordingly. That should work for you too.
#! /bin/bash

rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg # Remove any old copies of the DVD image before we begin.

echo "Creating DVD Image..."
hdiutil create -size 4.2g -volname "Mac OS X Install ESD" /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -fs HFS+ -layout SPUD

# hdiutil attach -nobrowse /Applications/Install\ OS\ X\ Mountain\ Lion.app/Contents/SharedSupport/InstallESD.dmg
hdiutil attach -nobrowse ~/Desktop/InstallESD.dmg 
hdiutil attach -nobrowse /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Copying Mountain Lion to new image..."
cp -pRv /Volumes/Mac\ OS\ X\ Install\ ESD/* /Volumes/Mac\ OS\ X\ Install\ ESD\ 1/

hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD\ 1
hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD

echo "Converting to read-only..."
hdiutil convert /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -format UDZO -o ~/Desktop/Mountain\ Lion\ DVD\ Image.dmg

rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Image Creation Complete. Please burn '~/Desktop/Mountain Lion DVD Image.dmg' to a DVD using Disk Utility."
open ~/Desktop/


[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: JFOC on Sep 13, '12 08:58:35AM

for somehow I need to add 'sleep' before detach to avoid resource busy

#! /bin/bash
# 2012-08-07 01 prw from Mac OS X Hints web site...
# added backslash before spaces in image names...
# Should be run on /Volumes/yourhddvolumename not on the SSD
# 2012-08-07 02 prw References are all relative, not absolute. So SSD it is.
# 2012-09-13 03 JFOC adding some sleep to avoid resource busy on detach

# Remove any old copies of the DVD image before we begin.
rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Creating DVD Image..."
hdiutil create -size 4.2g -volname "Mac OS X Install ESD" /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -fs HFS+ -layout SPUD

hdiutil attach -nobrowse /Volumes/Macintosh\ HD/Users/admin/Downloads/Mountain\ Lion\ 10.8/InstallESD.dmg
hdiutil attach -nobrowse /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Copying Mountain Lion to new image..."
cp -pRv /Volumes/Mac\ OS\ X\ Install\ ESD/* /Volumes/Mac\ OS\ X\ Install\ ESD\ 1/

sleep 10
hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD\ 1
sleep 10
hdiutil detach /Volumes/Mac\ OS\ X\ Install\ ESD
sleep 10
echo "Converting to read-only..."
hdiutil convert /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg -format UDZO -o ~/Mountain\ Lion\ DVD\ ImageLion.dmg
sleep 10
rm -f /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg

echo "Image Creation Complete. Please burn '~/Mountain Lion DVD ImageLion.dmg' to a DVD using Disk Utility."
open ~/
#-----------------------------------------------------------------------------------------------------------



[ Reply to This | # ]
Slight fix needed to burn from application
Authored by: louabill on Oct 18, '12 04:33:18PM
The script as it stands right now (18oct2012) requires that the user has copied the InstallESD.dmg out of the contents of the installation app to the desktop. To get the script to work properly without copying over the dmg first, the hdutil attach -nobrowse /Applications/Install... line should be uncommented, and the line following should be commented out:

hdiutil attach -nobrowse /Applications/Install\ OS\ X\ Mountain\Lion.app/Contents/SharedSupport/InstallESD.dmg
# hdiutil attach -nobrowse ~/Desktop/InstallESD.dmg 
hdiutil attach -nobrowse /private/tmp/Mountain\ Lion\ DVD\ Image\ read-write.dmg
Otherwise the script issues some errors and burns a blank DVD.
Still a very nice hint.

[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: lio256 on Oct 25, '12 01:02:43PM

If you do want to get the Mountain Lion installer InstallESD.dmg to fit on a single layer DVD, you can use the overburn feature of hdiutil in Mac OS X.

AFTER inserting a blank DVD, bring up terminal, navigate to the dmg folder and type:

hdiutil burn InstallESD.dmg

Depending on your brand of DVD your mileage may vary.



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: lio256 on Oct 25, '12 01:07:53PM

You can infact burn the installer to a single layer DVD, using a feature called overburn. This is much simpler than it sounds..

AFTER inserting a blank DVD, bring up terminal, navigate to the dmg folder and type:

hdiutil burn InstallESD.dmg

Depending on your brand of DVD your mileage may vary. It's not unusual to get errors after finishing the burn but as long as the Finishing Burn message is shown, the disc will function as expected.



[ Reply to This | # ]
Burn OS X Mountain Lion installer to single-layer DVD
Authored by: jprokos on Dec 26, '12 09:05:12AM

I think using any of these methods will cause the image to have a different checksum than the original. If that's not important to you, don't fret.


$ man hdiutil

-[no]optimizeimage do [not] optimize filesystem for burning.
Optimization can reduce the size of an HFS or
HFS+ volume to the size of the data contained
on the volume. This option will change what
is burned such that the disc will have a dif-
ferent checksum than the image it came from.
The default is to burn all blocks of the disk
image (minus any trailing Apple_Free).



[ Reply to This | # ]