Deploy Mac OSX with recovery partition k2000

I am currently stumped on deploying a mac image that includes the recovery partition. We need this to support device encryption. I referenced the below document and have not been able to make any progress as this seem to be referencing an older OSX version. I tried to update the scripts to my current version but the deployment now stops with "remaining partition space is too low."


I contacted support and the informed me that they dont support this and that I should ask my question on ITNinja.  Any help you can provide will be much appreciated.


3 Comments   [ + ] Show comments
  • hi, did you get this sorted as i want to add recovery pations to my mac images thanks - markc0 5 years ago
  • if its any help, i extracted the .sh file from the installer and edit line 30 to inc Disk Size instead of Total size. then i added this script as a pre install task, i selected the System Image Detail to force continue on errors and so far so good. - markc0 5 years ago
  • The following two articles helped me out a lot. Had to update the Create Partition and the Recovery Partition tasks and was able to successfully deploy the recovery partition. The articles explain why the changes are necessary.
    http://www.itninja.com/question/error-creating-osx-sierra-recovery-partition - jnchaney 5 years ago

Answers (1)

Posted by: jnchaney 5 years ago
Senior White Belt
The following two articles helped me out a lot. Had to update the Create Partition and the Recovery Partition tasks and was able to successfully deploy the recovery partition. 

The articles explain why the changes are necessary. 


  • What changes did you make to the "Create Partition" task? - esylvest 4 years ago
    • I think they may have fixed the Create Partition task in the latest K2000 update.

      The one I use is :
      Create Single HFS+ Partition

      if [ `arch` = 'ppc' -o `arch` = 'ppc64' ]; then
      /usr/sbin/diskutil partitionDisk disk0 $PartitionType "Journaled HFS+" "$KACE_SYSTEM_DRIVE_NAME" "100%" - jnchaney 4 years ago
      • Thanks, I'll give that a shot. - esylvest 4 years ago
      • Also had to use two different tasks for deploying the recovery environment. This one is for devices without the touchbar :

        Build OSX Recovery Partition (HighSierra)-Legacy No Touchbar

        # note the NAME of the partition image file
        # must match the imagename below
        # example imagename="nameorpartitionimage"

        if [[ ! -a $partloc ]]
        echo "could not find recovery partition image "
        echo "should be $partloc"
        exit 1

        dcheck=`diskutil list | grep disk0s | wc -l | awk '{print $1}'`
        if [[ $dcheck != "2" ]]
        echo "can not be run on disk0 without and existing HFS partition"
        echo "or with more than one. there are $dcheck on disk0"
        exit 1

        let rpartsizeb=`ls -l $partloc | awk '{print $5}'`
        let rpartsizes=$rpartsizeb/512

        let tds=`diskutil info disk0 | grep "Disk Size" | awk '{print $5}' | sed 's/(//g'`

        let efisize=220200960

        let partsize=$tds-$rpartsizeb-$efisize
        if (($partsize<$efisize))
        echo "remaining partition space is too low ($partsize)"
        echo "no room for OS"
        exit 1

        /usr/sbin/diskutil resizeVolume "$KACE_SYSTEM_DRIVE_NAME" "$res"

        slice=`df | grep disk0 | awk '{print $1}' `

        sleep 5
        /usr/bin/hdiutil detach $slice

        let parts=`gpt show disk0 | grep 48465300 | awk '{print $1 }'`
        let partl=`gpt show disk0 | grep 48465300 | awk '{print $2 }'`
        let partbase=$parts+$partl
        gpt add -b $partbase -s $rpartsizes -t 426F6F74-0000-11AA-AA11-00306543ECAC disk0
        pname="Recovery HD"

        dd if=$partloc of=/dev/disk0s3
        sleep 2
        /usr/bin/hdiutil detach $slice
        gpt label -i 3 -l "$pname" disk0

        exit 0 - jnchaney 4 years ago
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ