Sunday, August 17, 2008

How to make a bootable USB key with a Debian installer from Windows

This is something that should be obvious, but I managed to lose several days on this problem. I wanted to install Debian on my brand new mini-ITX server (with no CD/DVD drive, only several USB ports and an SSD drive), but I only had a Windows machine available. These are the steps I followed:
  1. Download NTRawrite.
  2. Download syslinux. The file that you need is syslinux.exe. It is located in the "win32" folder of the ZIP archive you downloaded.
  3. Download a Debian installer, e.g. the current installer for Lenny.
  4. Download a "netinst" ISO image for Debian, e.g. the most current image.
  5. Uncompress boot.img.gz.
  6. Format your USB flash drive, using FAT16, if possible.
  7. Use NTRawrite to write boot.img to the USB flash drive. Just launch NTRawrite.exe, enter "boot.img" and the drive letter of the USB flash drive. This step can be quite slow.
  8. Use syslinux to make the USB flash drive bootable. Just launch syslinux.exe with "-f e:" as argument (replace "e" by the drive letter of the USB flash drive).
  9. "Safely remove" the USB flash drive and put it back (I'm not sure this step is mandatory/useful).
  10. Copy the ISO image to the USB flash drive.
  11. "Safely remove" the USB flash drive again. VoilĂ . It is ready.
If, for a reason or another, you don't manage to boot on your USB flash drive, try formatting it using HP USB Disk Storage Format Tool. It might help.

5 comments:

Jonathan Xavier said...

Thank you so much for posting this. I decided to install etch and a half on my Lenovo X61s this weekend and this saved me hours of frustration.

Olivier Bruchez said...

You're welcome. I'm glad my post was useful to you!

Anonymous said...

Hello,
thanks for your precious post, very useful!
Is this method compatible with Squeeze Netinst ISO ?
Thanks again.
Pierrick

Olivier Bruchez said...

No idea. I've not tried to make a "fresh" installation since lenny.

Anonymous said...

I have tested with the two following images and I confirm it is okay to create an USB installer of Squeeze (under Windows) the same way you do with Lenny:

http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/i386/iso-cd/debian-testing-i386-netinst.iso

Thanks again for your post!

Pierrick

http://people.debian.org/~joeyh/d-i/images/daily/hd-media/boot.img.gz