Skip to main content

Hello all,

I am currently working on a script, mildem I load the installer via "softwareupdate --fetch-full-installer" and then install via "startosinstall" --eraseinstall --newvolumename "Macintosh HD" --agreetolicense --nointeraction".

Unfortunately, I currently observe the following error and only on the M1 MacBooks:

Has anyone observed the error. I must also say that all users are standard users without admin rights.

A check if the user has a SecureToken takes place in the script above and only if the user has a SecureToken, only if the has a token, the installer will be loaded and installed.

if [ "$HELPER" == "0" ] then processor=$(/usr/sbin/sysctl -n machdep.cpu.brand_string) if [ "$processor" == "Apple M1" ] then if [ -d "$install_macos_app" ] then free_space_check get_user_details rm -rf "$install_macos_app" softwareupdate --fetch-full-installer install_macos_app=$(find /Applications -type d -name 'Install macOS*') "$install_macos_app/Contents/Resources/startosinstall" --eraseinstall --newvolumename "Macintosh HD" --agreetolicense --nointeraction --stdinpass --user "$account_name" <<< $account_password else free_space_check get_user_details softwareupdate --fetch-full-installer install_macos_app=$(find /Applications -type d -name 'Install macOS*') "$install_macos_app/Contents/Resources/startosinstall" --eraseinstall --newvolumename "Macintosh HD" --agreetolicense --nointeraction --stdinpass --user "$account_name" <<< $account_password fi else if [ -d "$install_macos_app" ] then free_space_check rm -rf "$install_macos_app" softwareupdate --fetch-full-installer install_macos_app=$(find /Applications -type d -name 'Install macOS*') "$install_macos_app/Contents/Resources/startosinstall" --eraseinstall --newvolumename "Macintosh HD" --agreetolicense --nointeraction else free_space_check softwareupdate --fetch-full-installer install_macos_app=$(find /Applications -type d -name 'Install macOS*') "$install_macos_app/Contents/Resources/startosinstall" --eraseinstall --newvolumename "Macintosh HD" --agreetolicense --nointeraction fi fi else exit 0 fi

 

Has anyone successfully executed two commands with --preinstall-command? For example, I need to create the file and run jamf recon and for some reason, I can't do it. I have tried all impossible scenarios like --preinstall-command "touch /Library/dir/file; jamf recon" (creates file with ; semicolon ) bud didn't executes jamf recon and --preinstall-command 'touch /Library/dir/file; jamf recon' also I have tried two preinstall commands --preinstall-command "touch /Library/dir/file" --preinstall-command "jamf recon" but it only executes the last command 


Check out the pre-release v26.0 of erase-install. https://github.com/grahampugh/erase-install/releases/tag/v26.0

  • You can now supply multiple --preinstall-command arguments when using --erase or --reinstall. That means you can run multiple shell commands immediately before startosinstall kicks in.
  • You can now supply multiple --postinstall-command arguments when using --erase or --reinstall. That means you can run multiple shell commands after startosinstall has finished preparing, and before reboot.

Please test and give feedback in MacAdmins Slack #eraseinstall channel or here.


I'm running the following command within Jamf to wipe and install Big Sur 11.6.3:
/Library/Management/erase-install/erase-install.sh --build=20G415 --move --confirm --erase --current-user --no-fs
Once it gets to the "Erasing macOS" prompt, it never goes further. Am I missing a parameter? Any idea's/recommendations?


I'm running the following command within Jamf to wipe and install Big Sur 11.6.3:
/Library/Management/erase-install/erase-install.sh --build=20G415 --move --confirm --erase --current-user --no-fs
Once it gets to the "Erasing macOS" prompt, it never goes further. Am I missing a parameter? Any idea's/recommendations?


Do you have any restrictions in place? Either a Software Restriction in Jamf Pro, or any software that might prevent binary execution or disk mounting, like some modern security software?


Do you have any restrictions in place? Either a Software Restriction in Jamf Pro, or any software that might prevent binary execution or disk mounting, like some modern security software?


Yes, I do actually and you are correct that it was in place against this device. Thanks for quick reply and for pointing me in the right direction which should've been obvious to me.


Is it possible to erase and install to an older macOS than the current install? Example - I have a macOS Monterey 12.2 device but I need to install macOS Big Sur 11.6.3 for application testing. macOS 11.6.3 was installed prior to Monterey.

I've used "erase-install.sh --build=20G415 --erase --current-user" but this fails because the check is identifying this version as an "Unsupported macOS version".


Is it possible to erase and install to an older macOS than the current install? Example - I have a macOS Monterey 12.2 device but I need to install macOS Big Sur 11.6.3 for application testing. macOS 11.6.3 was installed prior to Monterey.

I've used "erase-install.sh --build=20G415 --erase --current-user" but this fails because the check is identifying this version as an "Unsupported macOS version".


@stmpl10 You cannot downgrade a macOS install via erase-install (the startosinstall tool that all install scripts use doesn't support it). You'll need to create a USB installer with 11.6.3, boot from it, erase the Mac's drive, then install 11.6.3.


@sdagley  Thank you!


Check out the pre-release v26.0 of erase-install. https://github.com/grahampugh/erase-install/releases/tag/v26.0

  • You can now supply multiple --preinstall-command arguments when using --erase or --reinstall. That means you can run multiple shell commands immediately before startosinstall kicks in.
  • You can now supply multiple --postinstall-command arguments when using --erase or --reinstall. That means you can run multiple shell commands after startosinstall has finished preparing, and before reboot.

Please test and give feedback in MacAdmins Slack #eraseinstall channel or here.


Yes it works. 26 release is great. Many thanks. And how about the situation with logs in jamf? After successfully erasing mac there aren't  any logs  but if I cancel the policy there is a log (Completed)


Yes it works. 26 release is great. Many thanks. And how about the situation with logs in jamf? After successfully erasing mac there aren't  any logs  but if I cancel the policy there is a log (Completed)


There is still no way for the policy to complete if the device is erased. Isn't that the whole point of the commands you are running, to workaround that?


There is still no way for the policy to complete if the device is erased. Isn't that the whole point of the commands you are running, to workaround that?


What @grahamrpugh said. So that I have a log of the starosinstall completion I've got dummy policies which basically do noting but log they were called that are triggered with the --postinstall-command (I use different ones for an erase or an upgrade)