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