This documents how you set up a USB drive to boot/install various things from it, without reformatting the disk by dumping a raw image onto it. This page documents elegantly moving only the necessary files to the USB drive, so that you can have one USB disk with many different install and boot possibilities.

Following these instructions, I have a USB drive that can boot Debian lenny installer i386/amd64, Ubuntu installer i386/amd64, and Debian lenny live.

Install grub onto it

See DebianNotes/Grub. Most of this document assumes that you have a working grub installation on your USB drive.

General overview

To boot something from a drive, you need:

The purpose of this page is to let you know where to get these things, and what grub entries you need to use them.

Debian/Ubuntu installer

Start off looking for the netboot installer, since you will want to put the minimum on the USB disk. You can directly download the vmlinuz or linux and initrd.gz files from debian mirrors. You'll just have to navigate to the right folder yourself, as a hint I found them at here:

http://ftp.us.debian.org/debian/dists/etch/main/installer-i386/current/images/netboot/

So look at dists/CODENAME/main/installer-ARCH/current/images/netboot

Make a subdirectory on your USB drive to hold these images (I use /boot/img/CODENAME-install-ARCH). That's it in terms of the files.

Next, you need to configure the bootloader. In your grub, do:

title Debian Etch i386 Netboot Installer from USB
root (hd0,0)
kernel /boot/img/etch-netboot-i386/linux
initrd /boot/img/etch-netboot-i386/initrd.gz
boot

There is also now a -gtk installer, and if you use that then you have to add extra parameters to the kernel in order to set up the video modes. To do that, look around in the directories to find a file containing the kernel boot parameters, for example here. All boot methods will have a file like this you can refer to to get extra boot parameters. Add these extra parameters to the kernel line in menu.lst.

Debian Live on a USB disk

There is a Debian Live, which is a very minor modification of regular Debian. They produce images for CDs and USB disks, but we don't want to have to lose our current filesystem on the drive. Thus, we extract the right files and set up grub to boot it.

Squeeze

References:

Lenny live

Lenny is much easier than etch.

Etch (obsolete)

Copy vmlinuz and initrd.img files to the usb key, and copy the casper/ directory over (don't rename it, you can put the kernel and initrd anywhere you want). The kernel and initrd are non-specific to the main filesystem in the casper/ directory.

(more later)

See also http://web.glandium.org/blog/?p=175

If usb disk isn't initilized by mount time, try these kernel/initrd options:

DebianNotes/UsbInstall (last edited 2012-01-03 01:35:59 by noway)