HOWTO: Build a DMG file from the command line on Mac OS X The first step is to create an Apple Disk Image File (DMG) distribution in a GUI tool, I used DMG Packager. Then create a directory that will contain all the files that you want included in the DMG file.
When Apple announced that OS X Lion would only be available through the Mac App Store, many people worried about the lack of a restore disc, which can be useful if, for instance, your hard drive fails. Worry no more – we’ll explain how to create your own bootable OS X Lion Installer.
While Lion being on the Mac App Store certainly has its benefits, many people still desire a physical backup, and more importantly, a restore medium for Lion that could be used in the event of a major software or hardware failure. Sure, you could go to the Apple store or an AASP, but you can save a lot of time and money by making a backup medium yourself.
The process is pretty simple, and although these instructions revolve around the developer preview, the process should (according to our source) remain identical for the July public release of OS X Lion. Just follow the simple steps below:
Creating A Physical Backup Of The OS X Lion Installer
Download Mac OS X Lion from the Mac App Store as usual. Once you have it, open a Finder window, locate the OS X installation file that you just downloaded, right click (or option-click) on it, and select “Show Package Contents.”
Within the contents of the package, you’ll see a “SharedSupport” folder. Open it. Inside that folder, you will find an image file called “InstallESD.dmg”. Copy this file to your desktop and mount it – this is the actual working image file that you can burn to a DVD, and clone to an SD card, USB thumb drive, or hard drive partition.
The rest of the magic all happens via OS X Disk Utility. Now, simply launch Disk Utility (located in the Utilities folder within your Applications folder). To burn to a CD, just insert a blank DVD, right click or option-click the DMG, and select “Burn InstallESD.DMG.”
To copy to an SD card, flash drive, or hard drive partition (Make sure your destination has at least 5GB free), just option-click the volume inside of the DMG, select “set as source”, click the “restore” tab in Disk Utility, drag the volume you want to copy it to into the “destination” field in the “restore” tab, make sure you select “erase destination”, and then click the “restore” button.
Voila! It is that simple, and now you can rest your mind, knowing that you have an emergency backup of Lion that you can carry with you and use in emergencies. You can view the tutorial process in action by checking out the below YouTube video.
Did you enjoy this tutorial? Let us know by sounding off in the comments!
These advanced steps are primarily for system administrators and others who are familiar with the command line. You don't need a bootable installer to upgrade macOS or reinstall macOS, but it can be useful when you want to install on multiple computers without downloading the installer each time.
Download macOS
Find the appropriate download link in the upgrade instructions for each macOS version:
- macOS Catalina, macOS Mojave, and macOS High Sierra download directly to your Applications folder as an app named Install macOS Catalina, Install macOS Mojave, or Install macOS High Sierra. If the installer opens after downloading, quit it without continuing installation.
To get the required installer, download from a Mac that is using macOS Sierra 10.12.5 or later, or El Capitan 10.11.6. Enterprise administrators, please download from Apple, not a locally hosted software-update server. - macOS Sierra downloads as a disk image that contains a file named InstallOS.pkg. Open this file and follow the onscreen instructions. It installs an app named Install macOS Sierra into your Applications folder.
- OS X El Capitan downloads as a disk image that contains a file named InstallMacOSX.pkg. Open this file and follow the onscreen instructions. It installs an app named Install OS X El Capitan into your Applications folder.
Use the 'createinstallmedia' command in Terminal
- Connect the USB flash drive or other volume that you're using for the bootable installer. Make sure that it has at least 12GB of available storage and is formatted as Mac OS Extended.
- Open Terminal, which is in the Utilities folder of your Applications folder.
- Type or paste one of the following commands in Terminal. These assume that the installer is still in your Applications folder, and MyVolume is the name of the USB flash drive or other volume you're using. If it has a different name, replace
MyVolume
in these commands with the name of your volume.
Catalina:*
Mojave:*
High Sierra:*
Sierra:
El Capitan: - Press Return after typing the command.
- When prompted, type your administrator password and press Return again. Terminal doesn't show any characters as you type your password.
- When prompted, type
Y
to confirm that you want to erase the volume, then press Return. Terminal shows the progress as the bootable installer is created. - When Terminal says that it's done, the volume will have the same name as the installer you downloaded, such as Install macOS Catalina. You can now quit Terminal and eject the volume.
* If your Mac is using macOS Sierra or earlier, include the --applicationpath
argument, similar to the way this argument is used in the commands for Sierra and El Capitan.
Use the bootable installer
After creating the bootable installer, follow these steps to use it:
- Plug the bootable installer into a compatible Mac.
- Use Startup Manager or Startup Disk preferences to select the bootable installer as the startup disk, then start up from it. Your Mac will start up to macOS Recovery.
Learn about selecting a startup disk, including what to do if your Mac doesn't start up from it. - Choose your language, if prompted.
- A bootable installer doesn't download macOS from the Internet, but it does require the Internet to get information specific to your Mac model, such as firmware updates. If you need to connect to a Wi-Fi network, use the Wi-Fi menu in the menu bar.
- Select Install macOS (or Install OS X) from the Utilities window, then click Continue and follow the onscreen instructions.
Learn more
For more information about the createinstallmedia
command and the arguments that you can use with it, make sure that the macOS installer is in your Applications folder, then enter this path in Terminal:
Catalina:
Mojave:
High Sierra:
Os X Dmg File
Sierra:
Mac Os X Dmg Download
El Capitan: