Skip to content

Instantly share code, notes, and snippets.

@codayon
Last active April 12, 2025 04:08
Show Gist options
  • Save codayon/8d208584906d5d1564266564fa716900 to your computer and use it in GitHub Desktop.
Save codayon/8d208584906d5d1564266564fa716900 to your computer and use it in GitHub Desktop.

Burning an ISO to a USB Drive with the dd Command in Linux

The dd command can be used to create a bootable USB from an ISO file.

Command:

sudo dd if=/path/to/your.iso of=/dev/sdX bs=4M oflag=sync status=progress

Parameters:

  • if: Input file. This is the path to the ISO file you want to burn.

  • of: Output file. This is the target device (e.g., /dev/sdX where X is your USB drive letter, e.g., /dev/sdb).

  • bs=4M: Block size. This is the size of the chunks of data being written. The 4M value works well in most cases, but feel free to adjust it depending on the size of the ISO and the speed of your USB device.

  • oflag=sync: Ensures that data is written synchronously, reducing the risk of data corruption.

  • status=progress: Displays the progress of the operation.

Important Notes:

  • Be Careful with the of Parameter: Double-check the device name of your USB drive (/dev/sdX). Selecting the wrong device could overwrite important data. To list all connected drives, you can use:
lsblk
  • Unmount the USB Drive Before Burning: Make sure the target USB drive is not mounted before you run the dd command. You can unmount it using:
sudo umount /dev/sdX*
  • Wait for the Process to Complete: The process might take some time depending on the size of the ISO and the write speed of your USB drive. Once the command completes, you'll see the status=progress output showing the number of bytes written.

  • Verify the USB Drive: After the process finishes, you can check if the USB is bootable by rebooting your system and selecting the USB drive from the boot menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment