script for detecting hd partition type and wiping out/re-creating

ImAMacGuy
Valued Contributor II

Anybody have a script that detects if a hard drive is partitioned using Core Storage or regular partitions, then delete them (recovery + main hd partition) and re-create as one drive?

I have a script that I use for regular drives that I converted to a .app that the techs use to partition non-CS/Fusion drives, but the CS/Fusion drives need to be re-partitioned manually. Having one script that does both would be very helpful as it seems 10.10 randomly decides when to use CS vs regular partitions.

i found this https://bryson3gps.wordpress.com/tag/corestorage/, but my script-fu skills are not good enough to understand fully what's going on with it.

3 REPLIES 3

tkimpton
Valued Contributor II

https://jamfnation.jamfsoftware.com/article.html?id=228

Can just erase the partition using disk utility. No need to make things difficult.

ImAMacGuy
Valued Contributor II

we've had mixed results. when we just do erase partition we get weird gremlins in the systems. random crashes, things not starting up. I see it time and time again, the tech forgets to do the partition wipe and reload (especially when going to a newer os than was previously on the machine), they bring ti to me because XYZ is happening, and I ask if they wiped the partitions and they said no. they go back and wipe it, and everything works.

granted if they don't bring it to me first, I don't know to look for the issues, so it may be working more than I realize...

bentoms
Release Candidate Programs Tester

@jwojda, yea we had fun with CS & partitioning. I've written it up: https://macmule.com/2015/01/02/casper-imaging-corestorage-volumes/

If using Fusion drives you'll need to look at the part that creates 2 Logical Volume Groups with a volume under each.. But, in doing so.. I'll don't think you'll be getting the benefits of Fusion drives.