automated way to wipe the restore and recreate a new partition?

Valued Contributor II

Pretty frequently (though for some reason not all the time), if the tech reimages a machine w/o destroying teh partitions using diskutil, Casper Imaging will error out. I've setup in our Netboot docs with teh commands to do the partition wipe, but I'm finding that the techs don't always use it.

Is there an automated way that can either be added to teh Casper Imaging workflow or be some kind of app on teh desktop that they can run? If the application route, then i"m thinking something that prompts for confirmation first, as the techs often netboot to run permission checks/surface scans on the local drive, and they don't necessarily want to wipe it.


Valued Contributor III

I'm planning to put a simple bash script on the desktop with this command:

diskutil partitionDisk disk0 jhfs+ "Macintosh HD" 100%

I'm not sure if you can add this to the configuration since the disk is targeted in Casper Imaging before you execute it (if the volume name remains the same then it may work).

I think the only time this would be an issue is with those hybrid drives, they have a funky partition map and I could never get the recovery partition to drop in the right place without doing a manual OS install.