Hello all,
In the interest of promoting 'no-touch deploys', here is a script that I run
as a 'before' script to deploy a Restore partition when imaging new machines
with Casper.
This runs and has been tested in 10.5.2. Even if you are running Tiger in
your organization, you can use this script if your restore/utility images
are Leopard.
Note: In my environment, the /Users directory lives on a partition called
Data. I recommend this configuration as it allows you to do whatever you
like to the boot drive without worrying about your clients' data.
################################################
#!/bin/sh
## SCRIPT PARAMETERS
volume='/Volumes/Macintosh HD'
mac='20g'
restore='20g'
data='0b'
# If restore partition does not exist, resize Macintosh HD and create
Restore and Data partitions.
if test -e /Volumes/Restore
then
# Restore partition already exists.
echo "Restore partition already exists."
else
# Restore partition does not exist.
echo "Resizing Partitions..."
/usr/sbin/diskutil resizeVolume "$volume" $mac JHFS+ Restore
$restore JHFS+ Data $data
fi
# Copy the restore image to the data partition
echo "Copying Restore image..."
ditto /Volumes/CasperShare/Packages/Restore_Image_Leopard.dmg
/Volumes/Data/Packages/Restore_Image_Leopard.dmg
# Apply Restore image with asr
echo "Restore the Restore with ASR"
/usr/sbin/asr restore -source
/Volumes/Data/Packages/Restore_Image_Leopard.dmg -target /Volumes/Restore
-erase -noprompt -noverify
# Remove cached package from Data partition
rm -Rf /Volumes/Data/Packages
echo "Restore image has been deployed."
################################################
--
Miles Leacy
Senior Macintosh Technician
Polo Ralph Lauren
212-318-7603
miles.leacy at poloralphlauren.com