thanks to https://timesaving.hatenablog.com/entry/2023/04/01/150000 (Japanese)
Tested in macOS Monterey.
Everything will done in terminal, except for downloading the Ubuntu image.
It may not require this step because we will write Ubuntu image with dd command.
I will leave it just in case.
You may can do in Disk Utility
, but I couldn't format, so we will do in terminal.
Search the usb drive with diskutil list
$ diskutil list
/dev/disk0 (internal):
#: TYPE NAME SIZE IDENTIFIER
...
/dev/disk3 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
...
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *15.5 GB disk4
1: EFI EFI 209.7 MB disk4s1
2: Microsoft Basic Data UBUNTU2204 15.3 GB disk4s2
Find the drive which you prepared.
You should check the part (external, physical)
.
In my case, I used 16 GB USB flash drive and it was /dev/disk4
.
Format by
sudo diskutil eraseDisk FAT32 UBUNTU2204 <your_usb_drive>
<your_usb_drive>
is what you found in the previous step.
In my case, it was /dev/disk4
, so replace the <your_usb_drive>
with /dev/disk4
.
(UBUNTU2204
is the drive name, I am not sure it will affect the drive name because we will rewrite the usb drive)
Convert by
hdiutil convert -format UDRW -o ./Downloads/ubuntu-22.04.3-desktop-amd64.img ./Downloads/ubuntu-22.04.3-desktop-amd64.iso
I used ubuntu-22.04.3-desktop-amd64.iso
, it depends on which version of ubuntu you use.
It will generate ubuntu-22.04.3-desktop-amd64.img.dmg
Unmount by
diskutil unmountDisk <your_usb_drive>
Write by
sudo dd if=./Downloads/ubuntu-22.04.3-desktop-amd64.img.dmg of=<your_usb_drive> bs=1m