Skip to main content

I'm having an issue with imaging my iMacs with a BootCamp partition,
if they already contain a BootCamp partition. I would like to reimage
the drives regardless of what partitions are already on there. So
what I would like is a script that partitions the drive and then lets
Casper Imaging do it's thing. Is there anyone out there that has
something like that?



Thanks,
Robert

My scripts can do it for u, I'll send tomorrow with instructions


I am interested in this as well.


Bukira,



Can you send me this script?


We do it by 2 Scripts (most of them are from the forums).
One before imaging and other at reboot.



1) Script to delete all partitions. Must run this with script priority set to "Before"



#!/bin/bash
# this assumes that /dev/disk0 is going to be the main HD in all systems
# Script priority in JSS should set to "Before" as this need to be done before Imaging
/usr/sbin/diskutil partitionDisk /dev/disk0 1 GPTFormat jhfs+ "Macintosh HD" 100%
echo "Disk0 has been re-partitioned."


2) Script to rename the partition to "Macintosh HD". Must run this with script priority set to "At Reboot"



#!/bin/bash
#
# get current boot volume name
#
export VolumeName=`diskutil info / | grep "Volume Name" | cut -c 30-`

# if it's not Macintosh HD, malke it Macintosh HD
if [ "$VolumeName" != "Macintosh HD" ];
then diskutil renameVolume "$VolumeName" "Macintosh HD"
fi

Thanks for the script. The problem I now face is that even though I have it set to run "before" imaging, it still runs after the creation of additional partitions for dualboot. I want to re-partition the existing partitions, and then recreate them during imaging. Does this make sense?


Reply