?
Solved

Shell Script editing

Posted on 2011-04-29
4
Medium Priority
?
575 Views
Last Modified: 2012-05-11
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%"

0
Comment
Question by:ISSit
  • 3
4 Comments
 
LVL 8

Accepted Solution

by:
point_pleasant earned 1000 total points
ID: 35491063
#!/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" "80%"
/usr/sbin/diskutil partitionDisk disk1 $PartitionType "Journaled HFS+" "$KACE_SYSTEM_DRIVE_NAME" "20%"



0
 

Author Comment

by:ISSit
ID: 35495028
Thank you, I will try this on Monday.  I appreciate you response.
0
 

Author Comment

by:ISSit
ID: 35504363
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?
0
 

Author Closing Comment

by:ISSit
ID: 35511951
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%"
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question