Restore partition questions

cwaldrip
Valued Contributor

There's not a lot of documentation, or current discussion, about the Restore partition feature.

I've created a restore image, made an OS package out of it with composer, uploaded that to my JDS, and in my test configuration I've setup a partition for the Restore partition.

The physical drive is 750GB, my restore partition image is about 10GB. I have the format as JHFS+, Make a restore partition is checked, reimage the partition is checked, and append a name to the partition is checked. I've set the partition size up to 25GB, and the Maximum percentage from 5% (37.5GB on this drive) up to 100%!

The imaging gets all the way through, but fails at the end with the same message, not enough space. What the heck?

1 ACCEPTED SOLUTION

daz_wallace
Contributor III

Ah, I see what you mean.

I had this issue before and the work around I used was to build the image I needed, then add a partition to the same disk to shrink the image I wanted as small as possible. Then capture this and deploy.

It was something to do with the disk image knowing the total size of the partition it was made on and so complaining if the destination was smaller than this.

View solution in original post

10 REPLIES 10

daz_wallace
Contributor III

Hi @cwaldrip

A possible easier method would be to use an image created by AutoDMG as this will (amongst other benefits) automatically deploy an OS and recovery partition when restored, negating the requirement to carry out the task manually as documented in the Admin guide.

Another option to possibly consider is the Create Recovery Partition installer (https://github.com/MagerValp/Create-Recovery-Partition-Installer) that will let you deploy a recovery partition, simply by running an installer.

Hope that helps!

Darren

cwaldrip
Valued Contributor

@daz_dar - a bit of confusion here. I'm fine with Apple's Recovery partition. It's a Restore partition that users can boot to and run self service as well as other utilities (DiskWarrior, Carbon Copy Cloaner, etc). Our users are typically remote (and I mean Syrian war zone, etc), so internet access is usually an issue so we have to be able to try and help them in the worst of cases.

This won't help if the drive is mechanically or seriously dying. But it's one more tool in the toolbox.

cwaldrip
Valued Contributor

A followup... On a lark I've changed the Restore partition settings to 250GB (for an image that is only 10.14GB), and 50%. The imaging completed successfully... but I have a 291.23GB Restore partition. Right... *scratches head*

daz_wallace
Contributor III

Ah, I see what you mean.

I had this issue before and the work around I used was to build the image I needed, then add a partition to the same disk to shrink the image I wanted as small as possible. Then capture this and deploy.

It was something to do with the disk image knowing the total size of the partition it was made on and so complaining if the destination was smaller than this.

cwaldrip
Valued Contributor

AH! Yeah, I think I know what you're talking about. When I mount the 'Restore' image I made, it shows as a 750GB (sparse?) image, but only 10.14GB are used. I'll try this...

cwaldrip
Valued Contributor

Thank @daz_dar. I built my image onto a small partition (20GB), then captured that with Composer. Worked perfectly. :)

daz_wallace
Contributor III

Great to hear!!

jchurch
Contributor II

what would be the best way to deploy this wonderful restore partition with out having to re-image the machine? possibly via a policy that creates and fills the restore partition on a client machine without the end user knowing?

cwaldrip
Valued Contributor

@jchurch Looks like i've caught up to your question. I'm looking at how I can re-image the restore partition.

I haven't found anything here on the forums about how to do it. I'm thinking this will need to be a shell script, probably using the ancient "asr" command.

Something like a policy to copy the restore disk image to the machine, then run asr to deploy the image to the partition. It doesn't look like the restore disk image created with composer has a checksum (oddly) though. I thought that was a step in the composer process. It's a block copy however, so it's silly quick for my small restore image.

I'll followup in this thread when I get something working.

jchurch
Contributor II

we use a policy to copy the image to a temp folder then a script to add the partition and restore the image to it.
i didn't write this. it was adapted from a script i got from @davidacland

#!/bin/sh

# Get the size of the disk in GBs
volumeSize=$(diskutil list | grep "Macintosh HD" | awk '{print $5}' | sed 's/(//g' | awk '{printf("%d
",$1 + 0.5)}')
echo "Volume size is currently ${volumeSize}GB"

# Work out volume size, less 15GB
newVolumeSize=$(expr $volumeSize - 15)
echo "Intended new volume size is ${newVolumeSize}GB"

# Resize volume
diskutil resizeVolume /Volumes/Macintosh HD ${newVolumeSize}g HFS+ Restore 0b

# Apply Restore image with asr
echo "Restore the Image with ASR"
/usr/sbin/asr restore -source /path/to/image/restore.dmg -target /Volumes/Restore -erase -noprompt -noverify

# Remove cached package from temp folder
rm -Rf /path/to/image/restore.dmg

# Hide the Restore Partition
chflags hidden /Volumes/Restore

echo "Restore image has been deployed."

exit 0