44

Recently I wanted to create a bootable USB of Linux mint. I found that there was a lot of conflicting advice/experience about whether the 'dd' command could be used to create a bootable USB. I decided to download an ISO and try. While dd definitely put the image on the USB stick it was not bootable. So my question is what is the magic ingredient that will make this work or why has this approach persisted if it does not work?

This is the command I used,

dd if=/mint/iso/image of=/dev/sdb1 oflag=direct 
jdowner
  • 554

6 Answers6

40

You are writing the image to the partition 1 of /dev/sdb

Change this to the following command:

dd if=/mint/iso/image of=/dev/sdb oflag=direct

this information was acquired from here

Dave G
  • 518
11

You copied the image to the first partition. Try copying to /dev/sdb rather than /dev/sdb1.

The actual mechanism varies a bit depending on the type of image you're using, but for simple DOS/MBR images you need to get a correct partition table (with the bootable partition marked as being bootable, and the MBR - the part of the initial 512 bytes that isn't the partition table - containing initial boot code.

2

From my experience with another Linux distro, all you should have to do is change the syslinux boot loader file and modify it to boot the USB. There's more detailed information about this at the syslinux wiki.

See also this Google search.

Pops
  • 8,623
1

You may need to have a BPB written into your bootloader. See Dex's post from Fri Apr 24, 2009 9:06 am at http://f.osdev.org/viewtopic.php?f=1&t=19681

The gist is that "if [your usb firmware] users floppy emulation and you do not have a BPB, it will NOT boot"

Armed with that advice, I was able to resolve this issue. I use linux, so my dd command was:

sudo dd bs=512 count=2880 if=IMG.bin of=/dev/sdb

You'll want to replace sdb with your usb device. You can find it by running

ls -l /dev/ | grep sd

before and after inserting your usb while linux is running. If you get e.g. sdb1 and sdb, chose the non-indexed option.

define
  • 11
0

I've also encountered this issue a few times.

What I found that works for me most of the time is to zero-fill the drive first.

  1. Change X to your drive letter or number, to find it:

    • Mac: diskutil list
    • Linux: lsblk
  2. Zero-fill the drive

    • Mac: dd if=/dev/zero of=/dev/rdiskX bs=4m
    • Linux: dd if=/dev/zero of=/dev/sdX bs=4M
  3. dd your image again

(4meg block sizes seem to be the quickest for me)

0

Have you made sure that your motherboard is set to boot from the USB device before it tries booting from your HDD? I would guess that may be your only issue - there's not much to using dd as you can see.

Eli Sand
  • 174