Find the answer to your Linux question:
Results 1 to 10 of 10
Hi All, I am trying to create a bootable usb thumbdrive using the dd command (this is what I was told to use from various sources). I am not trying ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! JeremyG's Avatar
    Join Date
    Jun 2007
    Location
    Cornwall, Ontario, Canada
    Posts
    32

    Create bootable USB with dd


    Hi All,

    I am trying to create a bootable usb thumbdrive using the dd command (this is what I was told to use from various sources). I am not trying to put linux on or anything, but rather, a memory tester image to test the memory of an employee's laptop (they don't have a floppy drive which is typically what we use).

    Everytime we try to do it with a CD instead, we get errors, or funky characters, not the image we need, this is why we are trying with a usb drive.

    Anyone know how to do this, or what options to use? The file name is memtest.img. I was thinking something like dd if=memtest.img of=/mnt/usb

    What am I doing wrong, cause the above says that /mnt/usb is a directory but I have to point it to usb, not stdout, and just copying the img file obviously doesn't work when booting.

    Thanks,
    Jeremy

  2. #2
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,126
    You are pushing it out to the mounted partition. You need to push it out to the device directly. Unmount it and then
    Code:
    dd if=memtest.img of=/dev/sd?
    Where sd? is the device name.

  3. #3
    Just Joined! JeremyG's Avatar
    Join Date
    Jun 2007
    Location
    Cornwall, Ontario, Canada
    Posts
    32
    thanks for clearing that up, but another question, will dd properly format the device/file to be bootable? or does it need other files/options to make it boot?

    Jeremy

  4. #4
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,126
    To be honest I have never had any faith in that method. Even if it does work it's by emulating a CD - remember these images are in the iso9660 format - not FAT, ext3 or anything else.

    The best way to install a distro to USB is to get one that is intended to do just that and use its install scripts. My personal preference is Slax but I think Mandriva and a few others work this way too. The distro needs to have USB support in the initrd file. If it does not it will not boot at all. That is why it is better to use a dedicated USB distro.

  5. #5
    Just Joined! JeremyG's Avatar
    Join Date
    Jun 2007
    Location
    Cornwall, Ontario, Canada
    Posts
    32
    The problem is though that I am not trying to create a USB distro, I am just trying to put a little memory testing program on the usb drive that needs to boot, can't be run from inside an OS. It typically uses a floppy, but the laptop doesn't have a floppy, and the cd keeps doing funky things.

    Any ideas?

  6. #6
    Just Joined! JeremyG's Avatar
    Join Date
    Jun 2007
    Location
    Cornwall, Ontario, Canada
    Posts
    32
    I tried

    Code:
    dd if=memtest.img of=/dev/usb
    and it failed. On bootup it said boot failed. Is there any other options I am suppose to use, or would this even work to create a bootable usb drive with the file memtest.img on it?

    Thanks,
    Jeremy

  7. #7
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,126
    My bad sorry. I didn't realise you were actually using a floppy image. I think the same problem may occur. I can't seem to find any USB images to use so there are two routes that stick out. They involve a bit of work though...

    For memtest you can either make format the USB drive and make it bootable with DOS (they usually come with a utility for this but it is most likely windows based) and then copy the USB ready .exe file :-

    http://www.memtest.org/download/1.70...+-1.70.exe.zip

    Or alternatively you can follow a procedure to make it bootable using syslinux and use the linux binary :-

    HOWTO: Boot Memtest on USB Drive (or Hard Drive) using syslinux - X86-secret.com Forums

  8. #8
    Just Joined! JeremyG's Avatar
    Join Date
    Jun 2007
    Location
    Cornwall, Ontario, Canada
    Posts
    32
    Thanks for the info again. The first link (windows based) was the one I had already tried. But because I have to use USB and not a floppy disk, it wouldn't work. I'll give the linux one a shot and see what happens putting it to USB.

    Thanks again,
    Jeremy

  9. #9
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,126
    As much as I abhor encouraging Windows based solutions you might find this HP Bootkey utility to be what you're looking for -

    Software and Drivers - download HP Drive Key Boot Utility, 7.41.3790.0

  10. #10
    Just Joined! JeremyG's Avatar
    Join Date
    Jun 2007
    Location
    Cornwall, Ontario, Canada
    Posts
    32
    I appreciate the work you put into it, however I had found that utility and tried it already. Formatting the usb drive as a floppy doesn't work. And if I format it as a hard drive, it actually gives me a linux bootable usb drive. I thought it was pretty cool that a windows utility gives you a linux boot drive (very basic, only 45 megs, all command line), however that didn't solve my problem anyways.

    The linux walkthrough is my best bet to get it to work. None of the windows solutions I have found worked, and I don't want to screw around with attempting to fdisk my usb drive and accidentally blowing away my whole harddrive (one walkthrough I found walks the line in seriously screwing up everything via fdisk).

    I'll give it a shot and see what happens.

    Thanks again,
    Jeremy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •