Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple bash script to create a Bootable ISO from macOS Catalina Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
hdiutil create -o /tmp/Catalina.cdr -size 9000m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Catalina.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build --nointeraction
hdiutil detach "/Volumes/Install macOS Catalina"
hdiutil convert /tmp/Catalina.cdr.dmg -format UDTO -o /tmp/Catalina.iso
mv /tmp/Catalina.iso.cdr ~/Desktop/Catalina.iso
rm /tmp/Catalina.cdr.dmg
@kepi

This comment has been minimized.

Copy link

@kepi kepi commented Apr 23, 2020

Current Catalina requires more space. I had to change -size 8000m to -size 10000m.

@julianxhokaxhiu

This comment has been minimized.

Copy link
Owner Author

@julianxhokaxhiu julianxhokaxhiu commented Apr 23, 2020

Thanks for the report, it worked on my side though, but I tested with the very first release. Updated the script :)

@LogicalChaos

This comment has been minimized.

Copy link

@LogicalChaos LogicalChaos commented May 8, 2020

I tried it with 10.15.4, had to increase it again, I used --size 12000m and it worked. Thanks for the gist.

@julianxhokaxhiu

This comment has been minimized.

Copy link
Owner Author

@julianxhokaxhiu julianxhokaxhiu commented May 8, 2020

Updated again, thanks for the feedback :) Glad it was useful. Cheers!

@panicsteve

This comment has been minimized.

Copy link

@panicsteve panicsteve commented Jun 23, 2020

First attempt with 10.15.5 failed:

% sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia  --volume /Volumes/install_build --nointeraction
Password:
Erasing disk: 0%... 10%...
Error erasing disk error number (22, 0)
An error occurred erasing the disk.

I increased the -size arbitrarily to 16000m and it worked. Not sure if that was the actual problem, just passing along the anecdote. :)

@julianxhokaxhiu

This comment has been minimized.

Copy link
Owner Author

@julianxhokaxhiu julianxhokaxhiu commented Jun 23, 2020

@panicsteve thanks! I did use this very same script recently to make an ISO and it worked just fine. Could be the issue is somewhere else. But thanks for letting us know!

@netinhoteixeira

This comment has been minimized.

Copy link

@netinhoteixeira netinhoteixeira commented Jul 3, 2020

Needed run as root:

$ chown +x create-iso.sh
$ sudo ./create-iso.sh
@julianxhokaxhiu

This comment has been minimized.

Copy link
Owner Author

@julianxhokaxhiu julianxhokaxhiu commented Jul 26, 2020

Updated the script again to 9000m ( ~9GB ) as it's enough to accomodate 10.15.6

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Aug 14, 2020

9000m didn't work for me. I made it 12000m and it worked.

@kaelef

This comment has been minimized.

Copy link

@kaelef kaelef commented Aug 18, 2020

FYI: I just tried and got the error message when using 9000m for the size. 9200m worked, though.

@sebastianherman

This comment has been minimized.

Copy link

@sebastianherman sebastianherman commented Sep 16, 2020

I had to use 20000m for it to work

@julianxhokaxhiu

This comment has been minimized.

Copy link
Owner Author

@julianxhokaxhiu julianxhokaxhiu commented Sep 16, 2020

I'm honestly surprised to see how everyone of us is using a different value. Could it be Apple is shipping the ISO image differently based on the HW where you download it? I do my tests inside of a VM.

What about you?

@kaelef

This comment has been minimized.

Copy link

@kaelef kaelef commented Sep 16, 2020

I don't know that people are trying small increments. Certainly a very large value will get things to work immediately without having to make multiple attempts. (My test was also in a VM.)

@sebastianherman

This comment has been minimized.

Copy link

@sebastianherman sebastianherman commented Sep 17, 2020

@julianxhokaxhiu I downloaded it on a late 2013 rMBP with 16GB RAM - no idea why this would impact the size.

@kaelef can't speak for others but generally i want an image as small as possible when storing it for later usage

@julianxhokaxhiu

This comment has been minimized.

Copy link
Owner Author

@julianxhokaxhiu julianxhokaxhiu commented Sep 17, 2020

can't speak for others but generally i want an image as small as possible when storing it for later usage

I do aim for the same. This is why I lowered the size back down again when I saw that 9000m was fitting. But maybe today is no more because of security patches and such. So 9200m sound plausible to me.

@Underdoge

This comment has been minimized.

Copy link

@Underdoge Underdoge commented Nov 17, 2020

Tested it with the Big Sur installer from Apple, making the obvious naming and sizing adjustments (12700m worked for me) and it also works fine, thank you.

@julianxhokaxhiu

This comment has been minimized.

Copy link
Owner Author

@julianxhokaxhiu julianxhokaxhiu commented Nov 17, 2020

I've created the relative script for Big Sur and you can find it if you're interested: https://gist.github.com/julianxhokaxhiu/286017b9872474d2c9b9fa090f6802bf

Glad you made it up yourself :) Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment