Skip to main content
Question

pre-partitioning scripts

  • November 10, 2014
  • 5 replies
  • 0 views

Forum|alt.badge.img+4

is there anyone that could help with a preinstall script that would erase the HD and create three partitions, one Macintosh HD, one Recovery HD and a DATA, I would like the Recovery to be 1GB the DATA to be either 400GB or <75% depending on the size of Drive

5 replies

Forum|alt.badge.img+13
  • Contributor
  • 180 replies
  • November 10, 2014

You could run something like this as a before script, modifying the values as needed.

#!/bin/bash
hardDiskID=$(diskutil list | awk '/GUID_partition_scheme/ {print $5}')
diskutil partitionDisk $hardDiskID 3 GPT JHFS+ "Macintosh HD" 24% JHFS+ "Data" 75% JHFS+ "Recovery HD" R

I used a script similar to the above for partitioning the drive to put the /Users folder on a separate partition. Not perfect by any means, but it should get the job done.


bentoms
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • November 10, 2014

@jacob_salmela, nice blog post. That is for linking to mine & referencing @localhorst whom I punched the idea off of. :)

@neilashdown, we partition as part of our configuration is casper admin. You should be able to set 1GB for recovery (but why? You can lay that down via an AutoDMG OS.dmg). Then set your Data drive to 75% of what's left.


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 15 replies
  • November 11, 2014

thanks for that but have an issue, I am trying to use Target disk to test this script before I install as a 'Before' it seems to read it but doesn't actually create the partitions, any advice appreciated


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 15 replies
  • November 11, 2014

The main issue I am having is that after updating to 10.10 and Server4 I can not longer Erase drives and partition then at NetBoot, what happens is that it attempts to unmount and erase and just skips past the partition part therefore not getting the result I would like to achieve. this all worked fine under 10.9 and Casper 9.5 :(

Any ideas?


bentoms
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • January 4, 2015

@neilashdown, I guess in the above you were referring to Casper Imaging pre-9.6?

I think I just posted on this issue (seeing as we both pinched the FSTAB idea off of @localhorst): https://macmule.com/2015/01/02/casper-imaging-corestorage-volumes/


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings