“Reinstall a Clean macOS with One Button” webinar resource page

talkingmoose
Moderator
Moderator

Hi everyone!

For those who attended Jamf’s “Reinstall a Clean macOS with One Button” webinar this week, we’ll have the recording posted hopefully sometime next week. In the meantime, here’s the link to the resources discussed.

https://jamf.it/eraseinstall-webinar

115 REPLIES 115

michaelshedrock
New Contributor

Has the Reinstall a Clean macOS with One Button webinar been posted yet?

talkingmoose
Moderator
Moderator

And finally, a Jamf Blog post updated for Catalina with written instructions following the workflow I outlined during the webinar

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

I've included at the end a lot of the questions asked during the webinar but didn't have time to answer.

Ajayv
New Contributor III

If I try to install the Catalina macOS on running Mojave it doesn't work using "softwareupdate --fetch-full-installer" this command".

f3ac11bbfdd64efc8d38bd5b82bcf41c

talkingmoose
Moderator
Moderator

@Ajayv, the --fetch-full-installer option is only available on macOS Catalina. It's not available on Mojave or earlier versions.

It can download Catalina, Mojave and High Sierra installers and then you can use Composer to create a package to put it on Mojave Macs.

If you don't have a Catalina Mac available, you can download Catalina and earlier installers from Apple's website at https://support.apple.com/en-us/HT208052.

wmehilos
Contributor

If anyone is having issues with the ---fetch-full-installer flag downloading incorrect versions, or it saying 10.15.1 can't be found, make sure you didn't set Catalina to be ignored by softwareupdate. You can reset it with the --reset-ignore flag.

We had a number of software compatability issues in our site so I blasted a Policy out to ignore/hide the Catalina upgrade to all of our Macs (including mine which had already been running Catalina). Completely forgot about it until banging my head against the wall for half an hour trying to get a fresh 10.15.1 installer.

swapple
Contributor III

New 16" MBP with macOS 10.15.1. I am trying to wipe and restart fresh but get this error:
"this version of macOS 10.15.1 cannot be installed on this computer."

john_sherrod
Contributor II

@talkingmoose Biggest issue I'm running into is that when I make this available via Self Service, it often fails to quit Self Service at the end which hangs up the reboot process. Any advice on how to work around that? I've got & at the end of my Files and Processes.

scottb
Honored Contributor

@swhps - likely a forked OS is why... 

sdagley
Esteemed Contributor II

@swhps As @scottb mentions, the 16-inch MBP probably has a custom build of 10.15.1. Run installinstallmacos.py on that machine and it should allow you to download the installer it needs (just look for the build # newer than 19B88)

scottb
Honored Contributor

Thanks, @sdagley - tried to quickly locate that info, but having none of those Macs here I could not locate the build number...that script should do the trick until 10.15.2...

davidhiggs
Contributor III

For those providing this option to end users, you might find adding this code handy to prompt the user to type 'ERASE' before wiping their machine and losing everything:

userConfirmation=$(osascript <<END 
display dialog "Confirm that you want to reset your Mac and lose all data by typing ERASE" with title "Erase Mac and Install macOS" default answer "" buttons {"Exit","Continue"} default button 1
if button returned of the result = "Continue" then return text returned of the result
END)

if [[ $userConfirmation == ERASE ]]
    then
        echo user confirmed intent to reset Mac and erase all data by typing ERASE
    else
        echo user cancelled Mac reset
        osascript -e 'display dialog "Cancelled." with title "Erase Mac and Install macOS" buttons {"OK"} default button 1'
        exit 0
fi

sdagley
Esteemed Contributor II

@scottb I haven't tried it personally, but you should be able to use VMware Fusion to create a macOS Catalina VM and spoof the model ID (it may also require spoofing a real serial #) of a 16-inch MacBook in the VM settings so that installinstallmacos.py will see the model specific 10.15.1 installer.

talkingmoose
Moderator
Moderator

@john.sherrod, did you try adding the new option --forcequitapps (Catalina only) to your command?

scottb
Honored Contributor

@sdagley - yes, my Catalina VM so far works fine with the info from my host MBP which is not in a JSS...
I could try to download that but I might not have the free space...

@john.sherrod I think the

--forcequitapps

piece was mentioned in William's video IIRC...

mhegge
Contributor III

"Downloading the installer app using Terminal takes about the same time as downloading it through Software Update.

To retrieve an earlier macOS version, add the --full-installer-version option followed by the macOS version number. This command gets the latest Mojave installer.

sudo /usr/sbin/softwareupdate
--fetch-full-installer
--full-installer-version 10.14.6"

If this is not possible in Mojave, why is it in the instructions? Is this for when you already have Catalina installed? This is not clear. :|

mhegge
Contributor III

Its just not working:
2eff5a644ecb4e999d71e0baec02ebc4

mhegge
Contributor III

Even after downloading a fresh Mojave installer, removing --forcequitapps and --agreelicense

Result of command:
Usage: startosinstall

nelsoni
Contributor III

@mhegge, remove the -- in "newvolumename" and re add them. If you are coping and pasting it will not translate the -- correctly. This happened to me every time I copied it.

mhegge
Contributor III

What am I missing?
2f00ba22a70646b29acfa10b6100d510

nelsoni
Contributor III

Some of the -- in your command are not formatted correctly so when you run the command it just ends in listing all of the arguments the command supports. remove all -- and re type them

mhegge
Contributor III

Ok, did that and it seems to have made a difference....waiting as Self Service is still up on the iMac I am testing..."Running..."

mhegge
Contributor III

Appears to hang in Self Service....
c0392805de4e4f798e2216fcb9d45943

nelsoni
Contributor III

It takes a while. at least it does for me

mhegge
Contributor III

I need to be able to push this out in, creating another "Instant" policy not using Self Service. I will want to do this for Labs. Man! It's been over 10 minutes...still waiting.

nelsoni
Contributor III

It's possible the command is hanging on the preserve container argument. I have never utilized that before so it could take longer. Good news is I have used this without self service and it does work.

mhegge
Contributor III

Does the preservecontainer just maintain the recovery partition?

nelsoni
Contributor III

Looking over the argument, I do not even see "preservecontainers" as a listed argument. I would just remove it because it could be hanging up the entire command.

mhegge
Contributor III

It may be a Catalina only argument? Removed and running again

nelsoni
Contributor III

Found it. It just preserves any other APFS volume other then the boot partition.

mhegge
Contributor III

https://www.jamf.com/jamf-nation/discussions/31496/help-with-upgrading-users-to-mojave

$ /Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --usage
Usage: startosinstall

Arguments
--license, prints the user license agreement only.
--agreetolicense, agree to 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.
--installpackage, the path of a package (built with productbuild(1)) to install after the OS installation is complete; this option can be specified multiple times.
--eraseinstall, (Requires APFS) Erase all volumes and install to a new one. Optionally specify the name of the new volume with --newvolumename.
--newvolumename, the name of the volume to be created with --eraseinstall.
--preservecontainer, preserves other volumes in your APFS container when using --eraseinstall.
--usage, prints this message.

nelsoni
Contributor III

--preservecontainer, preserves other volumes in your APFS container when using --eraseinstall.

mhegge
Contributor III

Still hanging. Not working :(

nelsoni
Contributor III

This is mine, obviously ignore the fact that it is for Catalina, but it has worked for me consistently. It was modified from Mojave which also worked for me.

'/Applications/Install macOS Catalina.app/Contents/Resources/startosinstall' --eraseinstall --agreetolicense --forcequitapps --newvolumename 'Macintosh HD'

nelsoni
Contributor III

Found one for Mojave

'/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall' --agreetolicense --nointeraction --eraseinstall --newvolumename 'Macintosh HD'

mhegge
Contributor III

Thanks! Appears to work now. Trial and error! @talkingmoose

mhegge
Contributor III

Spoke too soon. Did not work on second identical iMac. Policy log looks good though.
20ca49fadda64db7bd9ee82f5d0dbe0c

nelsoni
Contributor III

Might need a restart, a few people have mentioned that was necessary in some instances.

mhegge
Contributor III

Thats not good. Need to rely on this to run without issues. Anyway, it did not work to restart. Just came back to normal login.