Creating a bootable USB drive from an ISO in Linux is a straightforward process using built-in command-line tools. Most Linux distributions include fdisk and dd by default, making this method widely applicable. In this guide, we’ll walk through how to safely write an ISO to USB in Linux using dd.

Step 1: Identify the USB Drive

Before writing the ISO to USB in Linux, you need to determine the correct device name for your USB drive. Plug in the USB drive and run:

sudo fdisk -l

This command lists all storage devices connected to your system. Look for your USB drive by checking the model, size and type. It will usually be listed as /dev/sdX (e.g., /dev/sdb) or /dev/diskX (on some distributions).\

In my case, this happens to be /dev/sdc, as you can see in the screenshot below:

find usb drive in fdisk

⚠️ Warning: Be very careful when selecting the device name, as writing to the wrong disk will result in data loss!

Step 2: Write the ISO to the USB Drive

Once you’ve identified the correct device, use the dd command to write the ISO to the USB drive:

sudo dd if=/path/to/iso.iso of=/dev/sdX bs=1M

Replace /path/to/iso.iso with the actual path to your ISO file and /dev/sdX with your USB drive’s identifier.

Explanation of Parameters:

  • if=/path/to/iso.iso – Input file (the ISO image).
  • of=/dev/sdX – Output file (your USB drive). Do not include a partition number (e.g., /dev/sdX1), as you need to write to the whole disk.
  • bs=1M – Block size (1 Megabyte). Without this, dd defaults to a 512-byte block size, which can significantly down the process.

Step 3: Monitor Progress

When the dd command completes, it will output a summary similar to this:

123456789+0 records in
123456789+0 records out
123456789 bytes (X GB) copied, XX.XXXX s, XX.X MB/s

This confirms that all data has been written successfully to the USB drive:

dd output after writing iso to usb linux

The dd command does not provide real-time progress updates by default. On some distributions, you can add status=progress to see the write progress:

sudo dd if=/path/to/iso.iso of=/dev/sdX bs=1M status=progress

Step 4: Safely Eject the USB Drive

Once the process is complete, ensure all data is written by running:

sudo sync

Then, safely remove the USB drive:

sudo eject /dev/sdX

Remarks

  • For bigger ISO images, the process will take longer.
  • You should use the root device name (e.g., /dev/sdX) and not a partition (e.g., /dev/sdX1).
  • For all options you can use with dd, you can consult the dd man page.

Now, your USB drive is ready to boot into the written ISO image!

If you would like a video guide, I also have one available:

Leave a Reply

Your email address will not be published. Required fields are marked *

Trending