Skip to main content
Jamf Nation, hosted by Jamf, is a dynamic and knowledgeable community of Apple-focused IT admins and Jamf Pro users. Join us in person, in October, for the annual Jamf Nation User Conference (JNUC) to discover new and better ways to manage Apple devices.

Re-partition Disk Before Imaging

Description

I wrote this script to automate the process of re-partitioning the primary partition so that when Casper Imaging performs a block-copy of my images (which include "Macintosh HD" and "Recovery HD") I do not end up with multiple "Recovery HD" partitions. By default, Casper Imaging only targets the partition that contains the Macintosh OS, so without re-partitioning it is possible to end up with more partitions than required. The script works for both "primary partitions" and "logical partitions" including Fusion drives. The idea is to wipeout all local partitions and attempt to recreate what was there before. That way, Casper Imaging doesn't complain because the expected partition with "Macintosh HD" has not changed. I then follow-up the imaging process by running a script to convert any "primary partitions" to CoreStorage.

Download

Preview

Generating Preview...