How to: Imaging Mojave 10.14

chrisdaggett
Contributor II

First: This is not Apple approved. I know that, you know that, do it at your own risk. I do, this works fine. This is not a discussion about why or opinions :). Some of us have this need, this is one solution!

Step 1: Making a Mojave Image:
Have a good 10.14 master machine.

Mount master to another 10.14 machine (tested with 10.14.4, 10.14.5, and 10.13.3 - it does NOT work with 10.13.4, 10.13.5, or 10.13.6)

In Disk Utility Menu - View - Show all devices

Unmount APFS Volume under Container of drive you want to make image

File - New image - from Container (read-only). (NOTE: Unlike with High Sierra you DO NOT have to resize the partition first, the image is only as big as your used space)

Don't forget to scan image for restore! (from Menu - Images - Scan for restore)

STEP 2: IMAGING!

First Manually:

From Disk Utility on 10.14 machine/usb:
erase drive to APFS
Unmount Volume Under Container
Click on Container (not volume) and choose restore and Choose image made originally

My "IMAGER" https://tinyurl.com/APFSimager
(more info on my imager available in the High Sierra thread if you want specifics: https://www.jamf.com/jamf-nation/discussions/27001/high-sierra-imaging-how-to)

To use:

Download DMG and restore to USB Thumb drive. Thumb drive should be HFS+ and restore the HFS+ Partition on the Thumb drive with the Imager image above.

Place Firmware package in /Packages if you are imaging machines that are not at least on 10.13!
See my other thread for more info on pulling firmware: https://www.jamf.com/jamf-nation/discussions/27001/high-sierra-imaging-how-to

If you do not want to use Quickadd portion of imager simply delete the /Data folder.
Place quickadd.pkg in /Data if you want the machine to Enroll Via Quickadd after reboot.

Place APFS Container image in /Configurations (don’t forget to scan image for restore first)

Boot to USB and it will:
Erase internal drive 0 and make APFS, Restore Container, copy Firstboot files to run Quickadd, install firmware update if nescessary/included, and set startup disk and reboot.

34 REPLIES 34

tdilossi
Contributor

You, sir, are a rockstar!!! I just started looking into this yesterday and was working through trial and error. Thank you for doing the legwork for me!!

tstephenson
New Contributor

Well try this out but thank you for posting. Really needed this.

tstephenson
New Contributor

I'm unable to create the image in disk utility. When I go to File > New > Image from container is greyed out. Am I missing something? See attached screenshot.

b4e939a9c98c4cee92b87c1961b83d02

larry_barrett
Valued Contributor

Container 3 is your external disk. In the example above, he's creating the image from the internal harddrive and saving it to the drive.

chrisdaggett
Contributor II

@tstephenson @larry_barrett No, no Stephenson is doing it correctly. What version of macOS is that machine? I only tested it from 10.14.4 (and 10.13.3). Your screenshot is exactly what I do.

pdwyer
New Contributor

I am trying to figure this all out as it is exactly what I want to do. Just a bit fuzzy (a lot fuzzy), but do all the files go on a thumb drive? The mojave image alone was about 30 gig. I almost need a video or tutorial to help out. I like the directions as they are easy to understand. Thanks again for all the work on this.

chrisdaggett
Contributor II

@pdwyer Yes they all go on the thumb drive. You will likely need 64GB USB3 thumb drives. I use about 40 at a time (Imaging 1k machines).

So the process is:
Image thumb drive with my Imager above using disk utility (select thumb drive partition in Disk Utility - click restore - chose Imager image).
Copy Image (after scanning for restore in Disk Utility) to the Configurations folder on the thumb drive.
Boot to thumb drive to image the machine!

Optional (ish):
If the machines have never been at least on 10.13 they will need the firmware package placed in Packages - see other thread
If you want them to enroll in JAMF automatically place quickadd in /Packages with name quickadd.pkg
Please keep in mind this method will leave them NOT user approved, and not DEP enrolled. There is no solution for DEP Enrolled other than to DEP enroll, User Approved can be achieved with scripting, but it is not pretty! Depending on your situation its probably easier to harass the end users into clicking it.

pdwyer
New Contributor

@chrisdaggett Thanks for getting back to me so quickly. I am not able to erase the drive to APFS format on the 10.14 machine that I am running Disk Utility on for the step below. I can do Extended, but not APFS. Not sure why that is.

STEP 2: IMAGING!

First Manually:

From Disk Utility on 10.14 machine/usb:
erase drive to APFS
Unmount Volume Under Container
Click on Container (not volume) and choose restore and Choose image made originally

chrisdaggett
Contributor II

@pdwyer You are most welcome. Is it a solid state drive? is this from a 10.13 or 10.14 machine that you are running Disk Utility? Also you have to click on the drive and click erase I believe, not the partition.

Those are the only 3 factors I can think of for not getting APFS as an option.

cwaldrip
Valued Contributor

Best workflow we've made is to not fight it. Use the recovery partition to blow away the boot volume when you need to reimage. Let it boot afterwards. If it's not in DEP then create your admin account, copy the Jamf Imaging app to the machine, launch Jamf Imaging, select your OS-less configuration and choose the boot volume (yes, the one you're booted to). Let it rip. It'll reboot you have factory apps to install like Adobe or Office, and boot again. Ta-dah! Done.

If it IS in DEP then it gets enrolled and a script will install Jamf Imaging, as well as Pulse Secure and Bomgar so we can remote in if we need to.

The only 'problem' is when we're not up to speed with the current OS release. Then we just make sure the machine doesn't have the latest OS on it (which the users can't install themselves) and we do the same process. If we ARE up to speed, then we do option-cmd-R to boot from the latest internet recovery OS. If we aren't up to speed, and the machine DOES have the latest OS, then we use shift-opt-cmd-R. Then we may need to run the OS installer to get to our latest supported OS.

chrisdaggett
Contributor II

@cwaldripI have to be honest, I'm not sure how any of that is relevant to this thread :). I am glad that workflow works for you though!

For me that process is far too slow / time consuming. I can have a machine fully imaged, enrolled in JAMF, up to date, all software installed, all settings in place, user approved, etc.. in about 7 minutes. I am in charge of over 1400 machines that we use JAMF on (plus about 1200 older Macs without JAMF). I don't have that kind of spare time :-D.

I really want to leave those discussion out of the thread though, this isn't about comparing methods this is just one option :). I am very happy to hear that the recovery method is working for you however!

pdwyer
New Contributor

@chrisdaggett Think I am getting closer :) I get a size issue when I try to restore the image to the USB drive container. In looking at your notes you had a spot about resizing the container in terminal. Do I still need to do this if I am using 14.14 on both target and master machines? I read that as only if I was using 13.x machines.

chrisdaggett
Contributor II

@pdwyer Is this when restoring My Imager to the Thumb drive? That can happen if the thumb drive is less than the exact bytes of 64gb that my image is. Or do you mean restoring your image to a machine?

pdwyer
New Contributor

@chrisdaggett When I am trying to restore My Imager to the thumb drive. My image is about 31gb, so thought the thumb drive would be ok.

pdwyer
New Contributor

@chrisdaggett Sorry for so many questions. Do I first restore the image to the container and then just copy the My Imager files to the thumb drive or do I use restore for both? You mention about copying the image to configurations at some point, but if I restore it via disk utility, think I am confusing a step.

Sorry to bother you on this.

chrisdaggett
Contributor II

@pdwyer no worries at all I am happy to help. You restore my imager to the thumb drive, your image you don't restore you just copy it to the /Configurations folder on the thumb drive.

pdwyer
New Contributor

@chrisdaggett Just another clarification (glasses are foggy today), but I restore my imager to the "container" on the thumb drive, no the volume?

chrisdaggett
Contributor II

@pdwyer I am so sorry I think I see the problem now. I was explaining how to do imaging, not how to restore the Imager.

To restore the Imager to USB - format the USB HFS+
Restore the Partition of USB from Imager Image. Then
Copy Image made from APFS Container to /Configurations on USB drive. (After scanning the image for restore)

pdwyer
New Contributor

@chrisdaggett Please don't apologize for anything, you are a GREAT help. I have restored the imager to the usb, and am now copying the image that I made to the /Configurations folder. Question, my image name that I am copying over to Configurations is "Container disk4.dmg" does that sound right?

chrisdaggett
Contributor II

@pdwyer The name can be anything :). Just make sure you scan the image for restore (in disk utility menu / images / scan for restore - pick the image file)

jredge
New Contributor

@chrisdaggett So, I've gotten this to work on 85% of my machines. The other 15% are machines that have not been updated past 10.12, meaning they do not have the firmware on the machine. I followed your previous steps on how to package the firmware up and ensured its in the correct folder on my imager. However, I'm getting this error:

current_efi_version MBA71.xxx.xxx.xxx.xxxxxxxxxx
latest_efi_version
EFI Outdated

It then is unable to mount the Macintosh HD since it's converted to APFS but doesn't have the firmware. Any insight?

(I made sure to pull the firmware from the same model of MacBook)

Thanks!

chrisdaggett
Contributor II

@jredge

Sorry I am not understanding where the issue lies. It should be able to mount the partition, the script does this by default in order to set the startup disk (and copy the quickadd / firstboot etc).

I used this exact imager and script on over a thousand machines that DID NOT have High Sierra or APFS ever installed and it had no problem mounting the partition or installing the firmware so I am certain we can make it work :-D.

EF Outdated is exactly what you want to see, that then tells it to run the firmware script. Did you name your firmware package the exact file name as required? Does it mount to set the startup disk?

jredge
New Contributor

@chrisdaggett 353705ad184b47c99a92d6ee44662243
c4aae8ac99ad43aa9a1b586ac011ed26

Thanks for the speedy response! I managed to capture some pictures this time of what terminal is doing when I'm imaging a 10.12 machine. Let me know what you think

chrisdaggett
Contributor II

Ahh I see the problem now. It's not imaging, it's failing at Resizing "could not resize APFS container - invalid argument" is where the problem is.

This USUALLY occurs if the image was taken from an incompatible OS version. I have seen this many times myself. I would check what version of macOS the machine you used to take the image is on.

jredge
New Contributor

@chrisdaggett Thanks! So, I completely started from scratch just to eliminate any variables from me possibly rushing this. I have a master 10.14.5 Machine that is "out of box" (no configuration to it) that I am using as my image.

I also have a 10.14.5 Machine that is taking the image via the instructions above. Both are Early 2015 MacBook Airs.

When I'm imaging any machine that is on 10.13 or higher, there are zero issues. When I try to image anything that less than 10.13, I either get the "could not resize APFS Container - invalid argument" or that the target disk is busy. Any other ideas?

Thanks so much for your help and insight! It is greatly appreciated!

chrisdaggett
Contributor II

@jredge my best guess is that it needs the new firmware in order to mount the new partition. Has to be something different with Mojave, I had already updated all mine.

I’d you take that same machine and update the firmware (run it manually from any boot device) and run the imager again doesn’t it work?

jredge
New Contributor

Unfortunately getting the same response. The firmware install shows as successful. Killed the process after it failed and opened disk utility and here is the state of the internal SSD. Prior to this it was MacOS Extended Journaled running 10.12.6.

dcb38d6e344f44608081425d130ba915
665d782add754607b11ceb3b89efc3de

chrisdaggett
Contributor II

@jredge did you reboot after installing the firmware package? It has to boot after package to actually install the firmware. The package just sets the install in place. On next boot you will get an extra “loading bar” where it installing the firmware.

jredge
New Contributor

@chrisdaggett I did, but ended up with the same issue. For testing sake, I ran a NetInstall of 10.13.5 onto that machine, then ran the imager and it worked just fine. So definitely something to do with the Firmware not being present on the 10.12 and older machines. I'm going to try and rebuild the firmware package and see if something went screwy there.

Thanks again for your help!

chrisdaggett
Contributor II

@jredge Think I may have just run into the same problem you are having.

The problem is when the image is made on a larger byte drive. IE: All my macbook air 11" are 128gb, however some are JUST a hair lower in total bytes and so the image will not "expand". What I found I had to do was use Carbon Copy Cloner to image one of the smaller drives from the "large" image, then take a NEW image using Disk Utility of the "smaller" drive and use that as my master instead.

darryl_martin
New Contributor

@chrisdaggett I am trying to image a lab of identical Late 2015 iMacs running 10.13.6 and I keep getting the couldn't resize container error. Along with the firmware is outdated. I can only get the imager to work if I first install Mojave then run the imager. Any thoughts?

chrisdaggett
Contributor II

@darryl_martin it sounds like you need to pull a new firmware and install that first (or as part of the imaging process). I hadn’t run into that with 10.13.6 to Mojave but obviously I haven’t imaged every type of machine :). Perhaps yours had a firmware update between 10.13.6 and Mojave that it needs. Perhaps they are fusion drives? (Apple allowed APFS on fusion with Mojave maybe that requires new firmware)

Instructions can be found on my previous 10.13 imaging thread:

https://www.jamf.com/jamf-nation/discussions/27001/high-sierra-imaging-how-to

The only other time I ran into imaging issues were due to fluctuation in drive sizes. Even if 2 drives were “256gb” one would have a smaller byte count and fail to image. However Unless are somehow gaining extra bytes installing Mojave, this wouldn’t make sense here. The options to fix this are either: image the smaller drove using your image but with SuperDuper! Then make a new image of that with diskutility. (iE making a new image of the smaller byte drive), or resize the APFS container before you make the image. Even if you make the container 40gb it will resize to the full drive when you image.

Yam
New Contributor

Chris, thanks for all the works you put into this Mojave imager18. It is amazing. I was curious about where is the automated script locates at. I would like to make some changes to the Volume name in the script to execute correctly.

Thanks in advance.

sypheit
New Contributor

I am unable to upgrade my mac from Sierra to Mojave. I have another MB running Mojave, i did a target mode to Mojave MB from Sierra, but my Sierra is unable to create image. Any tips?