Pre Image Partitioning

zachary_fisher
New Contributor III

I am looking to, before I even push images, to split my hard drive into 2 partitions a 30% of Disk Space partition and a 70%. I want to put the Users folder on the partition that has 70% and leave 30% for core OS applications and services. How would one accomplish this?

9 REPLIES 9

mm2270
Legendary Contributor III

We do this today, but we aren't using Casper Imaging. We use DeployStudio. Its easy in that product to run a script to reformat or partition the drive in whatever way you want prior to laying down a base image. I don't know how easy it is to do with Casper Imaging though. I don't think there's a way to run a script prior to the rest of the imaging run, at leafs directly from within Casper Imaging.. I seem to recall asking for that functionality some years back actually, but I don't think its available yet.
I suppose you could build your imaging drive with a special script that when run asks for confirmation on reformatting the drive, then opens Casper Imaging and begins the imaging process? Not sure how feasible this is, since my experience with Casper Imaging is pretty rusty at this point.

stevewood
Honored Contributor II
Honored Contributor II

Actually, a script set to BEFORE will fire before the OS is imaged in Casper Imaging. So you can do your partitioning via a script. I used to do it that way years ago when I was doing the same.

You could also set the partition sizes in the configuration in Casper Admin (or web) and the drive will be partitioned prior to setting the OS on it.

mm2270
Legendary Contributor III

It does? Interesting. I didn't recall it working that way. Hence why I stated my knowledge of Casper Imaging is pretty rusty. I stand corrected than. Thanks for pointing that out Steve.
And I completely forgot you could set up the partitions right inside the configuration. That may make more sense than scripting it actually.

bentoms
Release Candidate Programs Tester

@zachary.fisher & @mm2270 we do this ourselves.

As per what @stevewood advised, we have partitioning setup in our configuration in Casper Admin as per the below:

external image link

(this will create the 2nd partition up to 670GB or 67% of the drives size, depending on what is the smaller)

On re-imaging Casper Imaging will see the partitions there & won't attempt to repartition.

We then use FSTAB to mount the "Users HD" to "/Users" (thanks to @localhorst for showing it's possible).

How we do it is here: http://macmule.com/2012/07/31/how-to-use-fstab-within-a-casper-imaging-workflow/

The great thing about partitioning like this, is that you can re-image in situ without having to migrate user data off/on.

We then run the following as a pre-flight script as part of our imaging workflow to correct the users home folders perms: http://macmule.com/2013/02/18/correct-ad-users-home-mobile-home-folder-permissions/

jacob_salmela
Contributor II

I do this in bash with a before script, using the same fstab method listed above.

skinford
Contributor III

@stevewood I have a simple question that I have not been able to find information for and I may have entered the search criteria incorrectly. I currently have systems with two partitions on them, a Macintosh HD and either a TEMP, or an HD_2 partition.

Is there a way to have Casper just combine them into one Macintosh HD partition again?

Or is there some way to script this easily?

Thank you for any assistance that you may give.

Have a great day!

stevewood
Honored Contributor II
Honored Contributor II

@skinford Are you wanting to preserve the contents of the drive, like merge the drive back to one partition while not losing any data? Or are you going to re-image these machines?

If you are talking about a non-destructive "merge", then you'll want to look at the diskutil command from the Terminal and the mergePartitions verb. However, this WILL BE destructive to the second partition. See the man page: diskutil Man Page. *CAUTION* THIS COULD CAUSE DATA LOSS. MAKE SURE TO HAVE A GOOD BACKUP.

If you are talking about re-partitioning during imaging, check the links in your other post on this. There are plenty of scripts out there to re-partition as part of the Casper Imaging process.

Hope that helps.

skinford
Contributor III

@stevewood Thank you for the response. I'm looking to merge and wipe the drive to image with a AutoDMG created install with the Casper join package added to that. I'll look and see what you talking about in my previous post but nothing that I have tried has been successful to this point.

I will keep digging and see what I can find. The assistance is much appreciated. Thank you again.

stevewood
Honored Contributor II
Honored Contributor II

@skinford look at this discussion that was in the post you posted: "Failed to delete Core Storage information" during 10.10 imaging.

The script at the bottom of that discussion should work for what you want. You'll need to upload that to your JSS and set it as a Before script in your imaging configuration.