Skip to main content

Hey guys, I really struggle on probably something easy.

We are partially using the erase tool from github to update some Macs in our fleet.

So the easy way is a policy with the package and the command line like

/Library/Management/erase-install/erase-install.sh --version=15.4.1 --reinstall --check-power --no-timeout --min-drive-space 20 --no-fs --rebootdelay 300 --power-wait-limit 300 --cleanup-after-use

 

My problem is that this policy, once completed, is showing failed. So it will start again popping up on the users macs.

I read about the launcher script, but it failes too.

I tried with the package and without, I tried the example script given by Github and the normal version.

Hows the process? I would just like to have jamf confirmed that the installation is completed.

Thanks!

 

@bet4test3r Did you https://github.com/grahampugh/erase-install/blob/main/erase-install-launcher.sh to call the erase-install script? I haven't used erase-install in a while but that launcher script was working to allow the policy running erase-install to log whether or not it was successful.


@bet4test3r Did you https://github.com/grahampugh/erase-install/blob/main/erase-install-launcher.sh to call the erase-install script? I haven't used erase-install in a while but that launcher script was working to allow the policy running erase-install to log whether or not it was successful.


Hey @sdagley thanks for the answer!

Yes I used this script. But iam not sure how exactly should a policy look like. Just add this script to the policy without the erase-install package or with? Any other things to be aware?


Hey @sdagley thanks for the answer!

Yes I used this script. But iam not sure how exactly should a policy look like. Just add this script to the policy without the erase-install package or with? Any other things to be aware?


@bet4test3r Add it as a Script payload to a policy with the erase-install package. The script payload parameters to do an erase will look something like this:


@bet4test3r Add it as a Script payload to a policy with the erase-install package. The script payload parameters to do an erase will look something like this:


I got it, thanks!

Now there is the "problem", that jamf says "completed" even when the user cancels the credential window or postpone the installation. I really hope it will go ahead for sure after the postponed time?!


I got it, thanks!

Now there is the "problem", that jamf says "completed" even when the user cancels the credential window or postpone the installation. I really hope it will go ahead for sure after the postponed time?!


Unfortunately no, if the user cancels that isn't considered an error. Use the "--max-password-attempts=infinite" option to prevent the user from canceling at the password prompt.


Unfortunately no, if the user cancels that isn't considered an error. Use the "--max-password-attempts=infinite" option to prevent the user from canceling at the password prompt.


Thanks, seems to work. Sadly now the process quits when the user is not connecting AC. 

How can I change it so the process will not end?

2025-05-12 14:12:55 | v37.0 | [check_power_status] WARNING - No AC power detected 2025-05-12 14:12:55 | v37.0 | [get_default_dialog_args] Invoking utility dialog 2025-05-12 14:18:27 | v37.0 | [check_power_status] Sending quit message to dialog log (/var/tmp/dialog.jiq) 2025-05-12 14:18:27 | v37.0 | [get_default_dialog_args] Invoking utility dialog { } 2025-05-12 14:18:32 | v37.0 | [check_power_status] ERROR - No AC power detected after waiting for 0s, cannot continue. 2025-05-12 14:18:32 | v37.0 | [erase-install] terminating the process 'caffeinate' process 2025-05-12 14:18:32 | v37.0 | [finish] sending quit message to dialog (/var/tmp/dialog.jiq) 2025-05-12 14:18:32 | v37.0 | [finish] Script exit code: 1 [erase-install-launcher] Exit (1) /Library/Application Support/JAMF/tmp/erase-install-launcher:94: invalid base (must be 2 to 36 inclusive): 1

 

Currently its like this:

[1] --version [2] 15.4.1 [3] --reinstall [4] --no-timeout --no-fs --cleanup-after-use [5] --rebootdelay [6] 300 [7] --min-drive-space [8] 20 [9] --check-power [10] --power-wait-limit [11] 300 [12] --max-password-attempts [13] infinite

Thanks, seems to work. Sadly now the process quits when the user is not connecting AC. 

How can I change it so the process will not end?

2025-05-12 14:12:55 | v37.0 | [check_power_status] WARNING - No AC power detected 2025-05-12 14:12:55 | v37.0 | [get_default_dialog_args] Invoking utility dialog 2025-05-12 14:18:27 | v37.0 | [check_power_status] Sending quit message to dialog log (/var/tmp/dialog.jiq) 2025-05-12 14:18:27 | v37.0 | [get_default_dialog_args] Invoking utility dialog { } 2025-05-12 14:18:32 | v37.0 | [check_power_status] ERROR - No AC power detected after waiting for 0s, cannot continue. 2025-05-12 14:18:32 | v37.0 | [erase-install] terminating the process 'caffeinate' process 2025-05-12 14:18:32 | v37.0 | [finish] sending quit message to dialog (/var/tmp/dialog.jiq) 2025-05-12 14:18:32 | v37.0 | [finish] Script exit code: 1 [erase-install-launcher] Exit (1) /Library/Application Support/JAMF/tmp/erase-install-launcher:94: invalid base (must be 2 to 36 inclusive): 1

 

Currently its like this:

[1] --version [2] 15.4.1 [3] --reinstall [4] --no-timeout --no-fs --cleanup-after-use [5] --rebootdelay [6] 300 [7] --min-drive-space [8] 20 [9] --check-power [10] --power-wait-limit [11] 300 [12] --max-password-attempts [13] infinite

@bet4test3r Remove the 

--check-power

option.

You can see what each of those options do by consulting the erase-install Wiki: https://github.com/grahampugh/erase-install/wiki/4.-Upgrading-or-reinstalling-macOS-without-wiping-the-system

 


@bet4test3r Remove the 

--check-power

option.

You can see what each of those options do by consulting the erase-install Wiki: https://github.com/grahampugh/erase-install/wiki/4.-Upgrading-or-reinstalling-macOS-without-wiping-the-system

 


Thanks, but then it will start the update also with 3% battery and if the battery will be empty while the update, it can cause some serious damage, no?


Thanks, but then it will start the update also with 3% battery and if the battery will be empty while the update, it can cause some serious damage, no?


That could be an issue, yes. I can't provide exact steps right now, but you could write are-flight script that would check the battery level using the following and decide if you want to update at that time:

system_profiler SPPowerDataType | /usr/bin/awk '/State of Charge/ { print $NF }'

(If it returns nothing then it's a desktop system)


That could be an issue, yes. I can't provide exact steps right now, but you could write are-flight script that would check the battery level using the following and decide if you want to update at that time:

system_profiler SPPowerDataType | /usr/bin/awk '/State of Charge/ { print $NF }'

(If it returns nothing then it's a desktop system)


Well, thats already getting too complication for an stupid System update :D 

I will write the affecting users directly to continue the process. But thanks a lot man!


Well, thats already getting too complication for an stupid System update :D 

I will write the affecting users directly to continue the process. But thanks a lot man!


I don't know if it's baked into the full installers that erase-install will use, but I believe that Software Update currently requires a minimum of 25% charge to install macOS updates on Apple Silicon Macs, and 50% charge on Intel based Macs.