How to Create a Bootable Linux USB on macOS

How to Create a Bootable Linux USB on macOS

- 4 mins

🐧 How to Create a Bootable Linux USB on macOS via CLI

This guide walks you through the process of creating a bootable USB drive for installing a Linux distribution, using only Terminal on macOS.


✅ Requirements


🛠 Step-by-Step Instructions

1. Prepare the ISO File

Download your preferred Linux .iso from the official website. For example:

~/Downloads/debian-12.10.0-amd64-netinst.iso

usb


2. Convert the ISO to IMG Format

Use hdiutil to convert the .iso to a .img.dmg file:

hdiutil convert -format UDRW -o ~/Desktop/debian-12.10.0-amd64-netinst.img ~/Downloads/debian-12.10.0-amd64-netinst.iso

usb

🔍 Explanation:

✅ Output file will be: debian-12.10.0-amd64-netinst.img.dmg on your Desktop.

Note: macOS adds the .dmg extension automatically — the resulting file will be linux.img.dmg.


3. Identify the USB Drive

Insert your USB drive and list all disks:

diskutil list

Look for a device that matches your USB drive’s size (e.g., 16GB, 32GB). For example:

/dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *15.5 GB    disk4
   1:       Microsoft Basic Data                         6.2 GB     disk4s1
   2:                        EFI ESP                     5.2 MB     disk4s2
   3:       Microsoft Basic Data                         307.2 KB   disk4s3
   4:           Linux Filesystem                         9.3 GB     disk4s4

⚠️ Important: Double-check this step to avoid overwriting your system disk.

usb


4. Unmount the USB Drive

Unmount the disk (replace disk4 with your actual identifier):

diskutil unmountDisk /dev/diskX # (Replace X with your USB disk for me "5")

You should see:

Unmount of all volumes on disk4 was successful

usb


5. Write the IMG File to USB

Now copy the .img.dmg to the USB using the dd command:

sudo dd if=~/Desktop/debian-12.10.0-amd64-netinst.img.dmg of=/dev/rdisk4 bs=1m

🔐 Enter your password when prompted. This process may take several minutes.

Optional: You can check progress by pressing CTRL+T during the write.

Example output:

633+0 records in
633+0 records out
663748608 bytes transferred in 161.418830 secs (4111965 bytes/sec)

usb


6. Eject the USB Drive

Once dd finishes, eject the USB drive safely:

diskutil eject /dev/disk4

usb

Now your USB drive is ready to boot.


🚀 Boot from USB

  1. Insert the USB drive into the target computer.
  2. Reboot and hold the Option (⌥) key at startup.
  3. Select the USB device (usually shows up as “EFI Boot”) from the boot menu.
  4. Begin the Linux installation process.

🧪 Troubleshooting Tips


🔗 References


👍 You now have a bootable Linux USB drive created using macOS without any third-party apps or Boot Camp!


Thanks for reading!

Guneycan Sanli

Guneycan Sanli

Guneycan Sanli

A person who like learning, music, travelling and sports.

comments powered by Disqus