Skip to content

Instantly share code, notes, and snippets.

@julianxhokaxhiu
Last active March 25, 2024 16:15
Show Gist options
  • Star 33 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save julianxhokaxhiu/d8c4a986ddb1cfc87e19a50eb238217f to your computer and use it in GitHub Desktop.
Save julianxhokaxhiu/d8c4a986ddb1cfc87e19a50eb238217f to your computer and use it in GitHub Desktop.
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
Copy link

ghost commented Aug 14, 2020

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

@kaelef
Copy link

kaelef commented Aug 18, 2020

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

@sebastianherman
Copy link

sebastianherman commented Sep 16, 2020

I had to use 20000m for it to work

@julianxhokaxhiu
Copy link
Author

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
Copy link

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
Copy link

@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
Copy link
Author

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
Copy link

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
Copy link
Author

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

@ammgws
Copy link

ammgws commented Aug 31, 2023

Instead of specifying the size, I tried -type SPARSE and was able to have the ISO be the perfect size:

>hdiutil create -o /tmp/Catalina.cdr -type SPARSE -layout SPUD -fs HFS+J

I haven't been able to boot into it yet, but don't think it's because of -type SPARSE

@julianxhokaxhiu
Copy link
Author

Logically the parameter makes sense, if someone could please test the resulting ISO I'd be happy to update the script. Thank you for looking into this.

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