Skip to main content
Question

Casper Imaging Partition

  • September 15, 2009
  • 5 replies
  • 14 views

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

5 replies

Forum|alt.badge.img+11
  • Contributor
  • September 15, 2009

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


Forum|alt.badge.img+15
  • Valued Contributor
  • July 20, 2012

I am interested in this as well.


Forum|alt.badge.img+15
  • Valued Contributor
  • January 16, 2013

Bukira,

Can you send me this script?


Forum|alt.badge.img+13
  • Contributor
  • January 16, 2013

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

Forum|alt.badge.img+15
  • Valued Contributor
  • January 17, 2013

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?