How to Create a Bootable Ubuntu USB Drive from macOS Using the dd Command

Why Use the Terminal to Create a Bootable USB?

While there are several third-party graphical applications available for macOS that can burn ISO files to USB drives (like BalenaEtcher or Rufus on Windows), many power users prefer using the built-in Terminal. Using the native dd (data duplicator) command ensures that you do not need to install unnecessary third-party software, avoids potential privacy or adware concerns associated with free burning tools, and provides a direct, low-level bit-for-bit copy of the Ubuntu ISO file to the flash drive. This method is highly reliable for creating bootable Linux installation media.

Step 1: Locate Your USB Drive Identifier

Before you use the dd command, you absolutely must identify the correct disk number for your USB drive. If you select the wrong disk, you could accidentally wipe your Mac’s internal hard drive.

  1. Insert your USB flash drive into your Mac (ensure it is at least 4GB and contains no data you want to keep, as it will be completely erased).
  2. Open the Terminal application (Applications > Utilities > Terminal).
  3. Type the following command and press Enter:
  4. diskutil list
  5. Look through the output for your USB drive. You can usually identify it by its size and name (e.g., “external, physical”). Note the identifier, which will look something like /dev/disk2 or /dev/disk3.

Step 2: Unmount the USB Drive

For the dd command to write to the drive, the disk must be physically connected but unmounted by macOS.

  1. Run the following command, replacing N with the disk number you found in the previous step (e.g., disk2):
  2. diskutil unmountDisk /dev/diskN
  3. You should see a message confirming the unmount was successful.

Step 3: Write the ISO Using the dd Command

Now you will write the downloaded Ubuntu ISO file to the USB drive. This step requires administrator privileges.

  1. Type the following command, but do not press Enter yet:
  2. sudo dd if=
  3. Locate your downloaded Ubuntu ISO file in the Finder. Drag and drop the ISO file directly into the Terminal window. This will automatically fill in the correct file path.
  4. Add a space, and then type the output path, replacing N with your disk number. To significantly speed up the write process, use rdisk instead of disk and add a block size parameter:
  5. of=/dev/rdiskN bs=1m
  6. Your final command should look similar to this:
  7. sudo dd if=/Users/YourName/Downloads/ubuntu-22.04-desktop-amd64.iso of=/dev/rdisk2 bs=1m
  8. Press Enter. You will be prompted to enter your Mac administrator password (the characters will not appear on screen as you type).
  9. Press Enter again to begin the process.

Step 4: Wait for Completion

The dd command does not provide a progress bar by default. The Terminal will simply appear to be stuck or thinking. Do not close the window or remove the USB drive. Depending on the speed of your USB drive, this process can take anywhere from 3 to 15 minutes. When it is finished, a new command prompt line will appear showing the number of bytes transferred. You can now safely eject the USB drive using diskutil eject /dev/diskN and use it to boot a PC or Mac into Ubuntu.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.