/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


How do I partition the mac drive into two partitions at deployment?

05/10/2013 4924 views

Hello All,

 

I'm currently using the "Create Single HFS+ Partition on disk0 & Format System Drive as HFS+" to prep the mac machines before deploying the mac image. So far, it's been successful. What I need to do now, is create two partitions. One being the mac partition for the mac image and a secondary as a MS-DOS (FAT). I would like it to split the drives in half. 50/50.

 

This is the Preinstallation Tasks

Create Single HFS+ Partition on disk0

#!/bin/bash

if [ `arch` = 'ppc' -o `arch` = 'ppc64' ]; then

    PartitionType=APMFormat

else

    PartitionType=GPTFormat

fi

/usr/sbin/diskutil partitionDisk disk0 $PartitionType "Journaled HFS+" "$KACE_SYSTEM_DRIVE_NAME" "100%"

 

&

 

Format System Drive as HFS+

#!/bin/bash

 

/usr/sbin/diskutil eraseVolume JHFS+ "${KACE_SYSTEM_DRIVE_NAME}" "${KACE_SYSTEM_DRIVE_PATH}"

 

exit 0

 

What do I need to change on the scripts above? 

Thank you,

Answer Summary:
0 Comments   [ + ] Show comments

Comments



Community Chosen Answer

2

Create Two Partitions on disk0 (80GB KACE, Scratch Remainder)

Sets up a blank system partition for KACE to image of 80GB, and a blank scratch disk partition of the remainder of the disk, on disk0 (primary hard disk).

#!/bin/bash
if [ `arch` = 'ppc' -o `arch` = 'ppc64' ]; then
    PartitionType=APMFormat
else
    PartitionType=GPTFormat
fi
/usr/sbin/diskutil partitionDisk disk0 $PartitionType "Journaled HFS+" "$KACE_SYSTEM_DRIVE_NAME" "80G" "Journaled HFS+" "Scratch Disk" "R"

Answered 05/10/2013 by: SMal.tmcc
Red Belt

  • here is also the one we used for 200gig mac hdd
    #!/bin/bash
    if [ `arch` = 'ppc' -o `arch` = 'ppc64' ]; then
    PartitionType=APMFormat
    else
    PartitionType=GPTFormat
    fi
    /usr/sbin/diskutil partitionDisk disk0 $PartitionType "Journaled HFS+" "$KACE_SYSTEM_DRIVE_NAME" "200G" "Journaled HFS+" "Scratch Disk" "R"
    • I added "/usr/sbin/diskutil partitionDisk disk0 $PartitionType "Journaled HFS+" "$KACE_SYSTEM_DRIVE_NAME" "60G" "MS-DOS FAT32" "Data" "R"

      Gives me an error - "Data does not appear to be a valid volume name for its file system"

      I tried - MS-DOS/MS-DOS (FAT)/ MS-DOS (FAT32),

      Am I missing something?

      Thanks for your quick response
      • fat 32 does not do dashes or slashes call it like DOS_VOL
  • Don't you want to use HFS for a MAC?
    • not to put windows on the other part
  • I want the script to create two partitions. The first one will be Journaled HFS+ and the second one to be MS-DOS FAT. The first one will be for the MAC OS of course.

All Answers

0

Reading through the comments, this is what you'll want to paste as your shell script:

 #!/bin/bash
if [ `arch` = 'ppc' -o `arch` = 'ppc64' ]; then
    PartitionType=APMFormat
else
    PartitionType=GPTFormat
fi
/usr/sbin/diskutil partitionDisk disk0 $PartitionType "Journaled HFS+" "$KACE_SYSTEM_DRIVE_NAME" "60G" "FAT32" "Data" "R"
Answered 05/13/2013 by: mpace
Red Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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