Hello All,
We currently use the following script to unmount, (re)partition and remount an internal HD from our netboot environment. Currently is sits on our dock in our netboot environment (currently 10.12.6- haven't rebuild netboot OS to 10.13 which i know is required for APFS).
#!/bin/sh
# Author: Jared F. Nichols
# Purpose: Nuke and pave the first internal drive to prepare for imaging.
clear
echo "Do you wish to nuke the internal drive?"
echo "THERE IS NO RECOVERY FROM THIS!"
printf "Y/N? "
read response
case $response in
Y|y|YES|yes|Yes|yEs|yeS|YEs|yES)
echo
echo
sudo diskutil partitionDisk /dev/disk0 1 gpt jhfs+ "Macintosh HD" 100%
echo
echo "Formatting complete."
echo "Continue with Casper Imaging."
echo
echo
exit 0 # Normal Exit
;;
N|n|NO|no|No|nO)
echo
echo
echo "Quitting"
echo
echo
exit 1 # User quit
;;
esac
Now with APFS becoming the standard, is it just a matter of changing the "jhfs+" to "apfs" before laying down a 10.13.x flavor OS?
Still really new to scripting and i can't take down our netboot server until a scheduled maint. window so just wanted to have everything ready.
Or if anyone has a better option, i'm open.
