Link to home
Start Free TrialLog in
Avatar of ISSit
ISSit

asked on

Shell Script editing

Our school has a Kace 2000 box.  I want  to format the Mac HD into 2 partitions to accommodate the Mac system and a scratch disk.  The Kace box has preinstallation tasks to perform these type of things, but it currently has only one task that formats 1 partition.  Does anyone know how to rewrite this so that it will create 2 partitions at 80% and 20%.

That shell script command is

 #!/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%"

ASKER CERTIFIED SOLUTION
Avatar of point_pleasant
point_pleasant
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ISSit
ISSit

ASKER

Thank you, I will try this on Monday.  I appreciate you response.
Avatar of ISSit

ASKER

Tried the script, on the iMac.  Unfortunately I had a memory stick in the system and the script fomatted the memory stick.  I installed some new software so imaging it now before I try again without the stick in.  Was wondering should the work if there is only one disk in?  I see that it is listed as disk0 and disk1; to me this means 2 physical disks it that different under Mac?
Avatar of ISSit

ASKER

The script worked, but looking for two drives.  It however gave the ground work for me to modify and get what I needed:  

Thanks


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