Skip to content

Instantly share code, notes, and snippets.

@aduzsardi
Forked from cobyism/osx-install-media.md
Created July 24, 2017 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aduzsardi/bd207f33e111a65c252722c185c94654 to your computer and use it in GitHub Desktop.
Save aduzsardi/bd207f33e111a65c252722c185c94654 to your computer and use it in GitHub Desktop.
Command to create installable OS X USB drive.

Creating a bootable macOS USB installer

  • First, plug in an 8GB (or bigger) USB drive, and use Disk Utility to erase it
  • If you use the default settings, you should wind up with a blank drive at /Volumes/Untitled.

With that volume in place, and with the macOS installer sitting in /Applications/Install\ macOS\ [VERSION].app, run the following command in your terminal to create a bootable install media (for Sierra):

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction

You should see output like the following—it might take a while to finish.

Erasing Disk: 0%... 10%... 20%...100%...
Copying installer files to disk...
Copy complete.
Making disk bootable...
Copying boot files...
Copy complete.
Done.

To boot from the installer, reboot your Mac and hold down the alt/option key, and it will let you choose to boot from the USB disk.

Enjoy!


If you’re getting an error like this saying "This copy of the Install OS X El Capitan application can't be verified. It may have been corrupted or tampered with during downloading.", then it means that the system time on your laptop is too far in the future for the certificates contained in your installer image (they expire a certain time after you originally download the installer). To proceed, do the following:

  1. Open up a terminal window, using the Utilities > Terminal menu option.
  2. As outlined in this Stack Overflow answer use the date command to set the date back to a time closer to when you would have downloaded the installer (i.e. Jan 1st, 2016 worked for me with El Capitan). E.g. date 0101090016
  3. Go back and attempt to reinstall OS X again, and it should work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment