Skip to content

Instantly share code, notes, and snippets.

@acodega
Created March 15, 2019 16:19
Show Gist options
  • Save acodega/57766c52a18a828b1ec44ad2492b5127 to your computer and use it in GitHub Desktop.
Save acodega/57766c52a18a828b1ec44ad2492b5127 to your computer and use it in GitHub Desktop.
startosinstall command & syntax
Command: startosinstall
Requires root access: Yes
Parameters:
- -usage: Displays all parameters available for the command.
- -agreetolicense: Agrees to the license agreement during deployment (Required for automated deployments).
- -rebootdelay: Delays reboot after preparation is complete, in seconds.
- -eraseinstall: Erases the existing APFS volume prior to installing macOS.
- -newvolumename: Renames the volume erased when used in conjunction with —eraseinstall.
- -converttoapfs: Coverts the existing filesystem to APFS. (Deprecated in macOS Mojave, however still exists in High Sierra).
- -nointeraction: Undocumented parameter that automates the deployment process without prompts.
Clean installation of macOS Mojave
1. Copy the Install macOS Mojave.app installer file to the target computers /Applications folder.
2. Enter or deploy the following command to the target system(s).
sudo /Applications/Install\macOS\ Mojave.app --agreetolicense --eraseinstall --newvolumename "Macintosh HD" --nointeraction
In-place upgrade installation of macOS Mojave
1. Copy the Install macOS Mojave.app installer file to the target computers /Applications folder.
2. Enter or deploy the following command to the target system(s).
sudo /Applications/Install\macOS\ Mojave.app --agreetolicense --nointeraction
There are two things to note prior to choosing whether to perform an upgrade or clean install:
First, as stated above the parameter to convert to the APFS filesystem is deprecated as of macOS Mojave (though still optional in High Sierra, hence why it can be toggled with via YES or NO). By default, macOS will convert SSD drives that will house the home folder. HDD's and Fusion Drives will not be modified.
https://www.techrepublic.com/article/pro-tip-performing-a-clean-install-or-upgrade-of-macos-mojave-via-terminal/
@regalrecaller
Copy link

I wasn't using sudo. I love and hate stupid mistakes. Thanks @acodega

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment