Casper Imaging

winkelhe
New Contributor

I continue to recieve the error "StackOverflowException the application
must shut down" at the end of imaging machines. It stops when copying the
jamf.conf file, which never happens. It never finishes the install leaving
the system unblessed and the invisble files visible along with not running
any of my "after" scripts. This happens even with the NoBlockCopy file
placed in the casper package contents. Has anyone else been experiencing
this issue?? I can't seem to figure out the problem. Thanks

Eric

12 REPLIES 12

winkelhe
New Contributor

does anyone know where to set "repair permissions" and "update prebindings" as defaults when imaging?? ever since casper 7 you need to click "custom" to select those options and if it's possible i'd rather have them on by default. i have people that rush through this and don't always double check stuff.

eric winkelhake
mundocomww
office 312 220 1669
cell 312 504 5155

talkingmoose
Moderator
Moderator

Date: Thu, 6 Aug 2009 11:46:42 -0500

Have you looked at Casper 7.0's new feature for using a Mac OS X disk image
(a la InstaDMG)? If you were to use this then repairing permissions and
updating prebindings shouldn't be necessary, I would think. The OS install
should be pristine.

--

bill

William M. Smith, Technical Analyst
MCS IT
Merrill Communications, LLC
(651) 632-1492

winkelhe
New Contributor

Would anyone else like to see the option to only specify a percentage for the partitioning of the taget device in casper imaging? is it just using diskutil partionDisk? because that command lets you specify a percentage of the drive and does not require a specific size.

eric winkelhake
mundocomww
office 312 220 1669
cell 312 504 5155

Not applicable

Here's the master repartition script I developed for us. It's based on a set
size for the SMALLER of the two partitions but also provides a way to create
a two partition solution.

#!/bin/sh

# rename the main partition to "SystemDisk"
diskutil rename disk0s2 SystemDisk

sleep 3

echo "drive has been renamed"

# split SystemDisk into a smaller (15GB) & larger "UserData" partition
diskutil resizeVolume disk0s2 15G JHFS+ UserData 10G

# pause for tasks to complete
while [ ! -z "ps -ax | grep diskutil" ]
do
sleep 1
done

echo "drive's been partitioned into two pieces"

# reformat the new, larger partition
diskutil reformat disk0s3

# pause for tasks to complete
while [ ! -z "ps -ax | grep diskutil" ]
do
sleep 1
done

# copy userdata and apps from SystemDisk to larger partition
ditto /Volumes/SystemDisk/Applications/ /Volumes/UserData/Applications/
ditto /Volumes/SystemDisk/Users/ /Volumes/UserData/Users/

# delete copied data from source
rm -dr /Volumes/SystemDisk/Applications
rm -dr /Volumes/SystemDisk/Users

# create symlinks to link copied data back to previous partition
ln -s /Volumes/UserData/Applications /Volumes/SystemDisk
ln -s /Volumes/UserData/Users /Volumes/SystemDisk

sudo bless -mount /Volumes/SystemDisk -setBoot

reboot

exit 0

tlarkin
Honored Contributor

from the man page

partitionDisk device [numberOfPartitions] [[APM]Format | [MBR]Format | [GPT]Format] [part1Format part1Name part1Size part2Format part2Name part2Size part3Format part3Name part3Size ...]

so something like this

diskutil partitionDisk /dev/disk0 2 GPT "Journaled HFS+" partition_1 75% GPT "Journaled HFS+" partition_2 24%

I always give or take that 1% to leave it out. Test this out of course as I just did it from the manual page

-Tom

winkelhe
New Contributor

yeah i know how to use the command i was just looking for some automation for imaging. we have machines with different size HDs and im unable to specify an exact size in casper imaging because of this. i was hoping for a way to build this command into the imaging process rather than rely on our techs to remember to do so.

eric winkelhake
mundocomww
office 312 220 1669
cell 312 504 5155

stevewood
Honored Contributor II
Honored Contributor II

I belive Tom, or Jared, or someone, uses a before shell script to do just
that. Write a bash shell that will use the command line to partition the
drive before imaging.

I'm actually looking at doing this because I haven't had a lot of luck with
my 10.6 builds and partitioning.

Steve Wood
Director of IT
swood at integer.com

The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475
Sent from Dallas, TX, United States

tlarkin
Honored Contributor

Oh, I see sorry I misunderstood. Sure there is a way to do this. If you know the sizes of your hard disks

diskutil info /dev/disk0 | awk '/Total Size/ { print $3 }'

Now all you gotta do is set those are hard coded variables and do some if thens, and I would recommend using the greater than (-gt) in a bracket comparison in a shell script to accomplish this. Actually, this would not be hard at all to do.

-Tom

tlarkin
Honored Contributor

I do use a script to partition my drives and when we were doing the dual boot image I used a script also. To give you a more in depth example, this is one way you could approach it.

If your HD is over 150gigs, then you get schema 1, if it is under 150gigs you get schema 2

#!/bin/bash

# this assumes that /dev/disk0 is going to be the main HD in all systems

HardDriveSize=diskutil info /dev/disk0 | awk '/Total Size/ { print $3 }'

# now compare results to run desired command

if [ $HardDriveSize -gt 150 ]

then do schema 1

else do schema 2

fi

done

Of course you gotta pump in the correct partition settings in the script. Then make sure that it is named what the target volume is in the JSS auto run data since it will most likely put the main OS partition on /dev/disk0s2 or something to that effect.

-Tom

winkelhe
New Contributor

hmmm...i have a script that does this however for some reason i was thinkin that casper imaging couldn't run scripts "before". not sure why but i only thought it was at reboot, my bad i was way off. it would be nice though to be able to specify percentages for partitions as a option you can assign to configs in the additional partitions area of casper admin.

eric winkelhake
mundocomww
office 312 220 1669
cell 312 504 5155

Bukira
Contributor

I do the same but I just use a percentage

25% windows and 75% mac

tlarkin
Honored Contributor

you can probably do this with manual trigger policies, compiled configurations and scripting with the asr command. All the features are there, just some of them lack a GUI.