Skip to content

Instantly share code, notes, and snippets.

@bhubr
Created December 29, 2021 00:00
Show Gist options
  • Save bhubr/6ef884b80410364ee7c51388417e8863 to your computer and use it in GitHub Desktop.
Save bhubr/6ef884b80410364ee7c51388417e8863 to your computer and use it in GitHub Desktop.
Prepare USB pendrive and burn MacOS installer

Run sudo diskutil list to get a list of drives. On my setup, I got this as part of the output:

/dev/disk2 (external, physical):
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:     FDisk_partition_scheme                        *15.9 GB    disk2
  1:             Windows_FAT_32 ESD-USB                 15.9 GB    disk2s1

Since my USB pendrive is /dev/disk2, I can repartition it as HFS+ like so:

sudo diskutil partitionDisk /dev/disk2 GPT hfs+ InstallMojave "100%"

From there, I can burn the Mojave installer to it (assuming it's present under /Applications):

sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/InstallMojave
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment