Apple's 10.13.4 update for macOS adds new commands that IT can use to easily and silently perform upgrades or clean installations of macOS—without a recovery partition—right from the Terminal.
Deploying macOS to new Mac computers or upgrading existing ones is a similar process to that found on competing operating systems. The process involves extensive planning and testing to ensure that everything occurs without a hitch and that existing software continues to work with the newer OS.
Part of the planning consideration depends on whether the process will be thick imaging or thin. The preferred best practice for deployments is thin imaging, which installs macOS directly to each device following the same installation process as if it was kicked off by the user for a clean, untouched environment.
While this option has existed for several versions of macOS (and OS X before that), as of High Sierra 10.13.4, Apple has added a few new options to the startosinstall command located inside the macOS installer app to not only silently install or upgrade macOS, but to also erase an existing installation and reinstall macOS on an APFS volume. Here's how how to deploy macOS with the new commands.
SEE: Software usage policy (Tech Pro Research)
- Apple computer with OS X 10.8 installed (or newer)
- Install the macOS High Sierra.app (10.13.4 or newer) from the Mac App Store
- Administrative access to the device(s) being deployed
- Switched network (optional—required only if deploying across the network)
How to do a clean installation of macOS on new Macs
From the Terminal or bash script, the command syntax is as follows:
/Path/to/Install\ macOS\ High\ Sierra.app/Contents/Resources/startosinstall --applicationpath /Path/to/Install\ macOS\ High\ Sierra.app --agreetolicense --nointeraction
The argument —agreetolicense is required if you wish to automate the deployment; otherwise, the command may halt during the license portion of the installation until it is manually agreed to. Similarly, the —nointeraction switch should also be used to facilitate automation so no prompts interrupt the process from completing successfully.
SEE: Five ways to make macOS more efficient on the go (free PDF) (TechRepublic)
How to erase the existing installation of macOS on upgraded Macs
/Path/to/Install\ macOS\ High\ Sierra.app/Contents/Resources/startosinstall --applicationpath /Path/to/Install\ macOS\ High\ Sierra.app --eraseinstall
The —eraseinstall flag is used on APFS volumes to fully erase the existing macOS installation before laying down a clean installation of macOS when paired with the arguments above in the clean installation section for a smooth removal and reinstallation in one fell swoop.
Note: Prior to using the —eraseinstall flag, verify that the installation(s) you wish to delete is using APFS and not HFS+. HFS+ volumes cannot be erased in this manner at this time.
- Why the Mac you know has no future (ZDNet)
- MacOS Mojave includes familiar iOS apps and points to Apple's future (Download.com)
- Apple macOS High Sierra: A cheat sheet (TechRepublic)
- 10 Terminal commands to speed your work on the Mac (free PDF) (TechRepublic)