Skip to main content
Question

Reinstall a clean macOS with one button

  • June 7, 2018
  • 27 replies
  • 147 views

Forum|alt.badge.img+7

They posted this on Jamf.com - thought it more appropriate to share here: sorry if this is a repost.

Reinstall a clean macOS with one button

27 replies

Forum|alt.badge.img+13
  • Honored Contributor
  • June 8, 2018

Good find. Too bad it will only work on APFS right now


Tangentism
Forum|alt.badge.img+10
  • Honored Contributor
  • June 8, 2018

Aren't they soon going to implement a 'factory reset' option on macOS similar to what iOS has?


Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 8, 2018

@Nix4Life Then upgrade comrade https://github.com/kc9wwh/macOSUpgrade


Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 8, 2018

@Tangentism well, yes.. the workflow shared is essentially a 'factory reset' - no telling how long until it's part of the user interface as a button in macOS or Jamf Pro.


larsc
Forum|alt.badge.img+4
  • New Contributor
  • June 15, 2018

Hey,
I've been trying to do this a couple of times now, following the instructions on https://www.jamf.com/blog/reinstall-a-clean-macos-with-one-button/ to the point, but it just gives back

> Result of command:

> Usage: startosinstall --volume <target volume path>

in the JSS log.
And the machine does nothing, Self Service still in focus. No difference if I add the '--volume' flag, it behaves the same. The command runs just fine if I type it directly into Terminal on the machine that I want to reinstall.
And yes, the machine has an APFS disk.

Any suggestions? Thx.


Forum|alt.badge.img+8
  • Contributor
  • September 14, 2018

Will this work for macOS Majave when it gets release next week?


Forum|alt.badge.img+12
  • Contributor
  • September 15, 2018

yes it does. 10.13.4 and up.


Forum|alt.badge.img+16
  • Valued Contributor
  • September 17, 2018

@larsc you need to quit Self Service as part of the script, since JAMF 10 this does not stop already initiated policeis from completing.
Something like as follows.

#!/bin/bash
osascript -e 'tell application "Self Service" to quit'
/Applications/Install macOS High Sierra.app/Contents/Resources/startosinstall --applicationpath /Applications/Install macOS High Sierra.app --eraseinstall --newvolumename "Macintosh HD" --agreetolicense --nointeraction

rastogisagar123
Forum|alt.badge.img+12

python will be nice way to do this!!


Forum|alt.badge.img+10
  • Valued Contributor
  • November 9, 2018

I would also be interested if a delete and install is supported through jamf Pro's Web UI?


ThijsX
Forum|alt.badge.img+20
  • Employee
  • November 11, 2018

Try the Erase&Install.app from ProWareHouse via https://bitbucket.org/prowarehouse-nl/erase-install/

Super cool application that wrapped the "oneliner" in a single app. Create a external disk, with the app and installers on it and you are done.
Or scope it to people that are going to offboard your organisation with the application, required Mojave/High Sierra installers and let them erase them self.

There are many options within this application, like unmanaging the device in Jamf or removing it etc.


Forum|alt.badge.img+7
  • Contributor
  • November 14, 2018

I'm running into issues with this too on a 2018 MBP. I keep getting the attached error. The installer is the most up to date for 10.13.6.


Forum|alt.badge.img+8
  • Contributor
  • November 14, 2018

I had that error a few weeks ago then i used Greg Neagle's python script to download the HS installers and had no issues after that. I suggest you give that a try, it's a very useful script.

https://derflounder.wordpress.com/2018/02/27/using-installinstallmacos-py-to-download-macos-high-sierra-installers/


Forum|alt.badge.img+14
  • Honored Contributor
  • November 14, 2018

I'm seeing this too, and can't figure out what's wrong. If I create a bootable USB drive using the same disk image it works fine.
If I try to open it from /Applications I get a message stating "This copy of the Install macOS application is too old to be opened on this version of macOS".

Downloading the installer using the "installmacos.py" script results in the same error.


Forum|alt.badge.img+8
  • Valued Contributor
  • November 14, 2018

Walts.9 - I had the same error. When I removed all the it worked.
I also did not have --nointeraction


Forum|alt.badge.img+6
  • Contributor
  • November 15, 2018

I have begun using this as a Self Service policy with Mojave 10.14.1 - no problems!

Now if only DEP/prestage enrollment could be forced on macOS, but the end user still has the option to skip network connection...


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • November 16, 2018

@walts.9, you have a couple of unnecessary options in your screenshot. Possibly, because you've included them, you're seeing the wrong behavior.

Don't include the --applicationpath and --nointeraction options.

You want to include the --eraseinstall and --agreetolicense options.

The --newvolumename option is... um... optional.


Forum|alt.badge.img+5
  • New Contributor
  • November 26, 2018

I have tried implementing this and I have a computer that is stuck in pending to deliver the installer app. I am not sure why it is not moving beyond pending. Any thoughts as to where I can look to find out why it is stuck in pending or any information I can provide on my setup to see what I might have done wrong? I am very new to JAMF and have been tasked at looking at how JAMF can help us with managing and imaging our computers. Thanks!


Forum|alt.badge.img+23
  • Esteemed Contributor
  • November 27, 2018

I am using @grahamrpugh 's handy project to do all of this stuff. Have a look: https://github.com/grahampugh/erase-install


mlitton
Forum|alt.badge.img+10
  • Contributor
  • December 4, 2018

@franton if you are testing and want the script to delete, do I need to make this variable .. yes? And also have the --erase in parameter 4

Safety mechanism to prevent unwanted wipe while testing

erase="no"


Forum|alt.badge.img+12
  • Contributor
  • May 21, 2019

It appears there is some important data missing in the instructions. Caching the package (silently installing) does not place the installer into the Applications folder on the device, it will place it in the Waiting Room (Library>Application Support>JAMF).

Anything after that improper instruction will not work.

More detail as to how to get the Install macOS High Sierra or Install macOS Mojave.app on the computers needs to be specified.

  • Install cached Policy based on cached installer or what?

https://www.jamf.com/blog/reinstall-a-clean-macos-with-one-button/


stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • May 21, 2019

@mhegge Actaully, if you read it closely it never mentions caching the installer. From the instructions, step 4:

4. Next, make a policy to run the package and deliver the installer silently onto the target Macs ahead of time.

After uploading the package created in Composer in step 1 you actually run that package, or install it. Since that package is simply dropping the installer into the Applications folder the macOS installer does not run, it just gets dropped to Applications.

Otherwise it would require an additional policy to run the cached package. Which would be inefficient.


Forum|alt.badge.img+12
  • Contributor
  • May 21, 2019

@stevewood It mentions "Cache" in several areas. If caching is not involved, it should not mention it as it is confusing.


stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • May 21, 2019

@mhegge agreed. Didn't see that further down the page since I was only looking at the top where the initial instructions are.


Forum|alt.badge.img+12
  • Contributor
  • May 21, 2019

The word "cache" should be replaced with "Deploy" or "Exists" depending on the context.