Linux – Make Live USB flash drive with dd

ddlinuxusb-flash-drive

The last time I booted from a USB flash drive was back in 2006. Ever since, I keep failing at making live USB bootables.

I tried getting Fedora 17 and 18, Ubuntu, and tons of other distros to boot from USB and never succeeded. I also tried different USB keys. Every single time, I get either kernel panic, or a bunch of meaningless errors when trying to boot.

I am sick of buying CDs and DVDs to be able to boot stuff; I want to be able to use my USB drive.

I've been using this basic command:

sudo dd if=Downloads/myiso.iso of=/dev/myusb bs=1M && sync

EDIT:
The reason for my failed attempts seemed to be corrupt hardware. I bought a new memory stick and the issue is gone.

Best Answer

This is an older question and you already discovered that in your case, the issue was a defective flash drive. For other readers with a similar problem, let me add a few other potential causes and solutions.

  1. Use of a standard ISO

    The ISO format is a container for a disk image of an optical disk. Systems can boot from an optical drive without the need for MBR or EFI, so the ISO doesn't contain this. Using dd to write the ISO to a flash drive results in media that lacks a boot provision.

    Some distros provide an ISO-Hybrid. This contains a boot provision, so the dd result can be booted. There are a couple of limitations, though.

    • You may not be able to boot a UEFI system. It is possible to configure this (see below), but not every distro with an ISO-Hybrid may be configured this way.
    • Writing the ISO-Hybrid with dd also writes the filesystem, which is read-only. So this method of installation will work like a live DVD session, but you won't be able to use it as your working OS.
  2. Use of non-matching boot provision

    Your computer will be set to boot in either UEFI or legacy mode, so the flash drive needs to either match or be provisioned for both. If you use just dd, it will work only if it is an ISO-Hybrid and it matches the computer's boot basis or has been designed for dual mode. If you make the drive bootable with a third-party tool, that needs to prepare it to match the computer or be dual mode. A dual mode setup can be done manually if you are an experienced Linux user.

    Not every third party tool can prepare a flash drive for UEFI or dual mode booting. These abilities are likely to change over time. I'm aware that Rufus can do this at the current time and there are likely some others. Shreyas P V has an answer on Ask Ubuntu that shows how to use Rufus to set up dual mode booting: How to create a dual boot mode pen-drive which can support both UEFI Mode and Legacy BIOS mode?.

    If you are experienced enough to do this manually, you probably won't be searching for an answer to this question. However, even if just for educational purposes, this answer by grawity provides a good explanation: Is a hybrid Linux USB-Stick for UEFI & legacy BIOS possible?

Related Question