6

I've downloaded Mac OS X Mountain Lion today and wanted to backup the installation image to a USB drive for later.

I've created a new empty partition of at least 8 GB size on the external drive using Disk Utility, and tried to restore the InstallESD.dmg image to this new partition, via the Restore menu.

However, doing that, I get the following error message, right after it finishes copying:

Cannot Allocate Memory

What can I do now?

3
  • If you found this because you are trying to build a USB installer for Yosemite (or later), check out Christian Bongiorno's answer.
    – quickthyme
    Commented Dec 29, 2014 at 23:09
  • @slhck - can I get the check for the answer? Commented Jul 8, 2018 at 5:41
  • @ChristianBongiorno You may notice that I provided an answer of my own which solved the issue for me at the time of writing (when I was using Lion / Mountain Lion).
    – slhck
    Commented Jul 8, 2018 at 16:43

4 Answers 4

11

This works:

 /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/YOSEMITE/ --applicationpath /Applications/Install\ OS\ X\ Yosemite.app

Got it from Apple Support directly

2
  • 1
    Even though the original question came long before, now that Yosemite has pulled the rug out from under itself, a lot of people are going to run into this and will likely end up here, so thanks for sharing this answer!
    – quickthyme
    Commented Dec 29, 2014 at 23:01
  • ^ People like me. I think this is about the tenth time I've ended up here. Figured it was time to get my password off my phone and log in and up-vote it.
    – iAdjunct
    Commented Mar 2, 2016 at 15:22
3

It could be that there is a checksum mismatch for the disk image, or you experienced a bug in Disk Utility.

You can try to use the asr command-line utility to copy the image yourself. To do that, you need:

  • The InstallESD.dmg image
  • A large enough HFS+ partition on an external drive created through Disk Utility, let's call it Install
  • A running terminal

In your terminal, enter the following line, but replace the path to your OS X installer image and the target partition:

asr restore --source Desktop/InstallESD.dmg --target /Volumes/Install

Now, you should get output similar to the following:

Validating target...done
Validating source...done
Retrieving scan information...done
Validating sizes...done
Copying    ....10....20....30....40....50....60....70....80....90....asr: did not copy blessed information to target, which may have missing or out-of-date blessed folder information.
100
Ejecting the source image...done

Now, you can boot into the installer from your USB drive too. To verify if it worked, go to System Preferences » Startup Disk, and check if your installer appears:

enter image description here

1

The asr command line suggested does not work under Mavericks, at least not in my case. (I get the error message File copy is not supported anymore. Use the --erase flag).

I was able to get around the Cannot allocate memory error by simply mounting the .dmg and having it mounted when I do the restore.

1
  • Got the same: bash-3.2# asr restore --source /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg --target /Volumes/YOSEMITE/ File copy is not supported anymore. Use the --erase flag. bash-3.2# asr restore --erase --source /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg --target /Volumes/YOSEMITE/ Validating target...done Validating source...done Could not find any scan information. The source image needs to be imagescanned before it can be restored. Commented Nov 29, 2014 at 17:59
-1

The easiest for me has always been to use a dedicated external harddrive, and just format it as Mac OSX only. Sure its annoying not to be able to swop files with a PC but i think the drive you put your disk image on shouldn't be used for general storage, it should be stashed safely in a safe. Use another drive for copying files etc.

You must log in to answer this question.

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