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%"
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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%"
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%"
ASKER