Skip to main content
Question

M1 Error startosinstall" --eraseinstall

  • September 7, 2021
  • 35 replies
  • 202 views

Show first post

35 replies

Forum|alt.badge.img+17
  • Valued Contributor
  • February 3, 2022

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.


Forum|alt.badge.img+1
  • New Contributor
  • February 7, 2022

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?


Forum|alt.badge.img+17
  • Valued Contributor
  • February 7, 2022

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?


Forum|alt.badge.img+1
  • New Contributor
  • February 7, 2022

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.


Forum|alt.badge.img+1
  • New Contributor
  • February 8, 2022

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".


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • February 8, 2022

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.


Forum|alt.badge.img+1
  • New Contributor
  • February 8, 2022

@sdagley  Thank you!


Forum|alt.badge.img+1
  • New Contributor
  • February 16, 2022

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)


Forum|alt.badge.img+17
  • Valued Contributor
  • February 16, 2022

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?


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • February 16, 2022

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)