Reinstall macOS if start-up volume erased
Glenn Fleishman shows how to recover a deleted start-up disk
There are a couple of options with an erased partition. Because Recovery didn’t work, the fastest way to install fresh is to make or borrow a macOS installer on a USB flash drive or a disk drive. We have instructions for making a bootable installer with macOS Sierra (as well as archived versions for several previous releases). You need at least an 8GB flash drive. The following article includes instructions on obtaining the installer, which might involve you having to use someone’s else Mac to download it, if you don’t have a replacement Mac on hand yet.
But if you can’t get access to another Mac or the necessary drive, it’s still possible to use a different Recovery mode on all recent Macs, dating back to 2010. Normally, you can start up a Mac while holding down Command-R to boot into what Apple now calls macOS Recovery. That allows you to run Disk Utility, reinstall or wipe and install the system, access Terminal for command-line functions, and so on. In that mode, when you choose to reinstall without erasing the drive, my recollection is that Recovery looks for the current OS system installer on your start-up disk in the Applications folder, and uses that.
Failing finding it, Recovery downloads the currently installed version of macOS (or OS X), which is about 5GB. When complete, it installs it and reboots, and places the installer in the Applications folder.
However, there’s another option: macOS Recovery over the Internet, which requires either a Mac model
released in 2012 or later, or most 2010 and 2011 models with a firmware upgrade applied. There, the Mac reaches out over a Wi-Fi or ethernet connection to download the relatively modest Recovery software, which then bootstraps the download of the full macOS installer. Apple says Internet-based Recovery should happen automatically on supported models, and you should see a spinning globe when that mode is invoked while the download occurs. However, if you have normal Recovery installed and it refuses to install macOS for some reason, you can manually invoke Internet Recovery.
While Command-R at start-up always installs whatever the most recent version you installed on your Mac, holding down Command-Alt-R brings down the very latest compatible version that can be installed. Apple also offers Shift-Command-Alt-R, which installs the version of OS X or macOS with which your computer shipped, or the next oldest compatible system still available for download.
(Apple just changed this behaviour with 10.12.4, but if you’re using Internet Recovery for a clean install on an erased drive, the new behaviour should be active as it will be pulled from the version of Recovery that’s bootstrapped from Apple’s servers. The pre-10.12.4 option is simply Command-Alt-R, but it acts like the new Shift-Command-Alt-R, installing the shipped operating system or the oldest compatible version.)
Apple recommends the Command-Alt-R option as the only safe way to reinstall a Mac with El Capitan or earlier versions of macOS if you want to be sure your Apple ID doesn’t persist even after erasure.
Recovery lets you install onto an erased partition, but only if Recovery wasn’t erased, too