Create a Debian Lenny installation USB stick

This is a short post that describes how to prepare your USB memory stick for a base installation of Debian Lenny. This will most likely also work on Debian based distributions like Ubuntu.

Download the latest Debian boot.img.gz file

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

Download the latest Debian netinst ISO image

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

Connect the USB stick in the computer and verify that the drive is recognized in /var/log/messages.

It is now time to write the downloaded files onto your USB stick.

First write the boot information to the stick

# zcat boot.img.gz > /dev/sdb

I am assuming that /dev/sdb is the memory stick. Always check that you are writing to the right device!

Mount the USB stick and copy the installation files from the ISO image

# mount /dev/sdb /media/memstick
# cp debian-testing-i386-netinst.iso /media/memstick

The USB stick is now ready to be used as a boot media just like a CDROM.

Edit:
You can also use UnetBootin, a graphical (GUI) thats lets you choose distributions etc and create a bootable USB stick.