MacOS – How tonstall macOS Sierra from Terminal in Recovery

installmacosrecoveryterminal

I tried installing macOS High Sierra but it failed. Probably because I have WD Black2 Dual Drive (120gb SSD + 1tb HDD).

I would like to reinstall macOS Sierra, and I have the installation file on another Volume on my system.

Is it possible to install it using the terminal from Recovery? If yes, please tell me the command(s) to start the installation.

(I have already formatted the target Volume – named "Macintosh HD" – back to HFS+ from APFS).

(Note: I tried installing using "Internet Recovery" but it said downloading and installation of Maverick will take 7+ hours! The other option it offers is it to install macOS High Sierra, which, as I said fails for me. So I am not interested in these options).

Best Answer

If you already have the Install macOS High Sierra.app application bundle, then the easiest way to install macOS is to create a macOS USB Installer and boot the Mac with it and install from there. Have a look at: How to create a bootable installer for macOS

The startosinstall command that is within the e.g. Install macOS High Sierra.app application bundle is what you need to use:

$ /path/to/Install\ macOS\ High\ Sierra.app/Contents/Resources/startosinstall --usage
Usage: startosinstall

Arguments
--applicationpath, a path to copy of the OS installer application to start the install with.
--license, prints the user license agreement only.
--agreetolicense, agree to license the license you printed with --license.
--rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes).
--pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall.
--converttoapfs, specify either YES or NO on if you wish to convert to APFS.
--installpackage, the path of a package to install after the OS installation is complete; this option can be specified multiple times.
--usage, prints this message.

Example: startosinstall --converttoapfs YES 
$

Note: The Arguments shown above I believe are when the --usage was done when running macOS normally, not from Recovery HD, so there may be some additional Arguments shown when run from the Recovery HD.

Here is an example of the command I used on one of my systems when booted from a macOS USB Installer with a separate copy of the Install macOS High Sierra.app application bundle on it:

/path/to/Install\ macOS\ High\ Sierra.app/Contents/Resources/startosinstall --agreetolicense  --volume /Volumes/Macintosh\ HD'

Note: The startosinstall command used was the one in the copy of the Install macOS High Sierra.app application bundle that I copied to the macOS USB Installer after it was created, not the one that gets written to the macOS USB Installer when it's created.