Installing Debian from a USB Stick

I'm setting up a new web server for a client of mine, and was supposed to start installing it this evening. After unpacking it I realized that this new HP ProLiant DL 120 came without a cd-rom and thus the Debian ISO netinstall image I had downloaded was useless. Considering I'm doing this install at home, I don't exactly have a PXE server available either

My quest for installation via an USB stick started, but most of the information I found on how to create one was geared towards users that already have Debian or any other Linux distribution already installed. Again, this is being done at my home, which currently is a Linux free zone. I do have a Linux server available, the one that hosts this site amongst other things, but that is located elsewhere.

After fiddling with WinImage a bit, I was still unable to properly create a bootable stick. Everything seemed to go ok, until I actually tried booting it. All I got was a unpleasant "Boot Error" on the server, and no installation love at all. Trying to run RawWrite for Windows on Vista x64 didn't yield any better results, as that doesn't even see the USB stick as a device it can write to at all.

I came very close to giving up creating this on Windows and was ready to do a virtualized Debian install and then try to create the boot device from there, but then I remembered seeing a Windows version of dd somewhere. It turns out that Chrysocome, that also makes RawWrite for Windows, also maintain a port of dd for Windows

As a last ditch attempt before trying a virtualized Debian instance I decided to give it a try, and it turned out to work beautifully!. So, here is my step-by-step guide for creating a bootable USB stick for Debian on Windows

  1. Download the required Debian files.
    I ended up with boot.img.gz and debian-LennyBeta2-amd64-businesscard.iso. I used the businesscard version since the USB stick i was using was only a 128MB one.
  2. Download dd for Windows and extract it somewhere
  3. Extract the boot.img file from the downloaded boot.img.gz file.
    I placed the boot.img file in the same directory where I extracted the dd binary to avoid path problems
  4. Use dd to write the boot.img to your USB stick
    Open a command prompt and run dd. I used the following command: dd if=boot.img of=\\.\g: where g: is the drive letter Windows assigned to my USB stick.
  5. After dd finishes, copy the debian-LennyBeta2-amd64-businesscard.iso file to the USB stick
  6. Boot target computer with the USB stick connected
  7. Install Debian

Of course, your target computer or server must be able to boot from a USB device and it's BIOS must be configured to actually try booting from USB. The HP ProLiant DL120 did this out of the box, so I didn't have to configure anything at all.


I'm sure this is pretty common knowledge for a lot of people, but I wasn't able to quickly find a concise description on how to use Windows to create the bootable USB stick so I thought it would be best to record my steps in case it helps someone else. Besides, I can always look at this post again the next time I need to do something like this.

October 9, 2008 at 9:49pm | 19 Comments
Tagged: , , and

19 Comments so far

  1. thinkweird, on October 12, 2008 at 6:00am, said:

    You don't need a USB at all to install Debian. Just download the Mini.iso (7.5MB) and load the iso from Avlgomgr.

    Alternatively, you can also use Grubfordos to load the kernel image and intrid for net installation.

    Edit Comment

  2. h0bbel, on October 12, 2008 at 6:22pm, said:

    @thinkweird: Thats interesting, I'll have to check that out. Thanks for the tips!

    Edit Comment

  3. Vaidotas, on October 12, 2008 at 8:59pm, said:

    UNetbootin (Universal Netboot Installer) is a cross-platform utility that can create Live USB systems and can load a variety of system utilities or install various Linux distributions and other operating systems without a CD.

    Edit Comment

  4. Christian Mohn (h0bbel), on October 12, 2008 at 10:52pm, said:

    @Vaidotas: Also very interesting. I might just have to do a followup post now with the tips I'm getting.

    Edit Comment

  5. craigevil, on October 13, 2008 at 12:10pm, said:

    UNetbootin - Homepage and Downloads
    http://unetbootin.sourceforge.net/

    Describes USB/Sd install for the Eee but most applies to a desktop without a cd drive as well:
    DebianEeePC/HowTo/InstallOnSDcardOrUsbStick - Debian Wiki
    http://wiki.debian.org/DebianEeePC/HowTo/InstallOnSDcardOrUsbStick

    Edit Comment

  6. Emralegna, on November 9, 2008 at 10:25am, said:

    Hello,

    I would like to thank you Christian Mohn ; I'm now able to install Debian without a CD drive and make my USB stick bootable from Windows. :)

    craigevil I was searching a utility like this one for months !! :')

    Thank you very much too ! :D

    Edit Comment

  7. Christian Mohn (h0bbel), on November 9, 2008 at 12:08pm, said:

    @Emralegna: Glad you found it useful!

    Edit Comment

  8. deanet, on January 15, 2009 at 8:22pm, said:

    nice tutorial .. i'll try ..

    thx alot

    Edit Comment

  9. Timur I., on January 27, 2009 at 6:31pm, said:

    Wow! Thank you very much!
    I always wanted to write in my blog something like that. Can I take part of your post to my site?
    Of course, I will add backlink?

    Sincerely, Timur I.

    Edit Comment

  10. Christian Mohn (h0bbel), on January 27, 2009 at 7:33pm, said:

    @Timur I: Sure, feel free. :)

    Edit Comment

  11. felipe, on February 21, 2009 at 4:55am, said:

    damn it! I downloaded boot.img.gz from your link, i didn't realize that it is for amd64, my pc is a celeron. so during the boot there was an error message "use a 32 bit distribution". now I dit it right. thanks a lot

    Edit Comment

  12. Joe, on February 26, 2009 at 1:06am, said:

    How can I create a larger partition on the usb drive, so I can copy a full debian iso image?
    Say 800 Mb

    Cheers

    Joe

    Edit Comment

  13. Animous, on March 12, 2009 at 6:58pm, said:

    Thanks for the article!

    Don't know why debian project didn't create yet a tool to make things like this easy and fast.

    Edit Comment

  14. CodeTech, on March 31, 2009 at 3:39am, said:

    This is one of the reasons that linux remains on the sidelines. YES, there's a way to do it, NO, someone didn't think it was important enough to include the details at the Debian site.

    Most people I know who want to get away from Windows are quickly put off by what they perceive as needless complexity in linux... a perception that is not incorrect.

    Thanks Christian, this helped a lot. I had to quickly switch computers for my server, since apparently the old 80Gb HD on my old one is failing. Luckily I had a tiny little standby, but no floppy or CD drives.

    Edit Comment

  15. Neon, on April 18, 2009 at 4:06am, said:

    Man this saved me after I couldn't get a CD drive to work on a computer I needed to put Debian on and this saved my day!

    Awesome info, thanks!

    Edit Comment

  16. pow, on June 5, 2009 at 7:36pm, said:

    Thanks for the howto! btw..it took forever to get dd to finish on a 2gb stick connected to usb 1.1 but well, it worked!

    Edit Comment

  17. Windsor Schmidt, on July 2, 2009 at 1:05am, said:

    Thanks for the writeup!

    I wanted to add that when using the dd tool for Windows, passing it the option -bs=1M increased write speed to my USB-drive immensely.

    Cheers!

    Edit Comment

  18. Anonymous, on September 8, 2009 at 2:29pm, said:

    Hi

    I followed this procedure and it worked for me as well. Thanks a lot!
    There is a minor thing, though:
    I am using a Kingston data traveler 2GB capacity, but after dd does its work, the 2 GB stick appears to have only 238MB.
    II wonder if there is an option for dd that allows to use its full capacity.

    Regards

    Edit Comment

  19. Installing Windows from a USB Stick - h0bbel.p0ggel.org, on September 9, 2009 at 2:59pm, said:

    ...B Stick">Installing Windows from a USB Stick One of the most popular posts on this site is the "Installing Debian from a USB Stick" post from October 2008. Seems like it's about time I posted something similar but for Windows inst...

    Edit Comment

Leave a Comment?


« Remove stale computers from WSUS  —  Watchguard Certified System Professional »

Recent Comments