A number of our newer Macs are unable to Netboot (seems like any that shipped with Lion or higher). We have gone through the iphelper stuff but no luck. That said, I wrote a down and dirty script to repartition the disk, install the Recovery OS, reboot to said OS and reimage. Yes, I know it's not very pretty but does what I need it to (mostly):
#!/bin/sh
diskutil resizeVolume /dev/disk0s2 219G hfsx Restore 30G
killall Finder
jamf mount -server server.address.here -share CasperShare -type afp -username casperadmin -password somepassword
asr restore --source /Volumes/CasperShare/Packages/CasperRestore.dmg --target /Volumes/Restore --erase --noprompt
diskutil rename disk0s3 Restore
chflags hidden /Volumes/"Restore"
killall Finder
jamf unmountServer -mountPoint /Volumes/CasperShare
The intial test device was a Macbook with no recovery partition so disk0s3 is the correct designation for the newly created Restore partition. On a newer Macbook pro, there is already an apple recovery partition so the newly created partition would be disk0s4. Is there a way I could modify this portion of the script to pick the right disk identifier?
Also with the diskutil portion:
diskutil resizeVolume /dev/disk0s2 219G hfsx Restore 30G
How would I go about setting a 30G restore partition and setting disk0s2 to whatever space was left as we have multiple HD sizes?
