Preparing a USB key for installation

Evan Klitzke eklitzke.lists at
Mon Jan 29 17:54:42 UTC 2007

On Sun, 2007-01-28 at 16:04 +0000, Julius Maclean wrote:
> Hi Chaps,
> First post. Appologies in advance if this is the wrong list. This concerns installation of Fedora based distros from a USB key. I've read the guides that say one should run;
>  dd if=diskboot.img of=/dev/sda
> This works fine and I've been able to install OS using this method. However the partition table that this command creates is rather unusable for any thing other than installations. [output of fdisk -l listed below].

Here is what I have done in the past. First, you partition the drive
normally, using ext2/3 or FAT for the first partition. If you want to
use the drive with Windows, obviously FAT is the way to go, if not then
it doesn't really matter. Then you install GRUB onto that partition,
just as it was a normal hard disc. Then you take the ISO for the CD you
want to be able to boot from, and copy the contents of the ISO onto the
USB drive. When I installed FC6 I downloaded the network install
"boot.iso" and just copied off the kernel and initrd, but in principle
you can download a real install CD/DVD and put that on the USB drive as
well. This is how I installed Fedora onto my laptop (it is one of those
"legacy free" laptops without a CD drive), so I guarantee you it will

The next step is figuring out how to get GRUB to boot the drive
properly. I'll do an example of how I would actually do this in real
life, using the Fedora boot.iso net install image:

$ mkdir iso
$ sudo mount -o loop boot.iso iso
$ cat iso/isolinux/isolinux.cfg
--- snip ---
label linux
  kernel vmlinuz
  append initrd=initrd.img 
label text
  kernel vmlinuz
  append initrd=initrd.img text
--- snip ---

I just want the regular installer, so it looks like I want to load the
vmlinuz kernel and use the initrd.img initrd. So what you want
in /mnt/usbdrive/boot/grub/menu.lst (or whatever) is a line like this:

title Fedora Core 6 Net Install
kernel (hd0)/isolinux/vmlinuz
initrd (hd0)/isolinux/initrd.img

Obviously you'll have to replace the (hd0) with the appropriate entry
from the file in your GRUB installation. Some installers have
lots of extra options that must be passed to them. For example, you can
see in the isolinux.cfg file that the "text" install appended an option
text to the kernel line. If you wanted to add this option, you would put
it on the kernel line in your GRUB config, e.g.

kernel (hd0)/isolinux/vmlinuz text

This general method (putting GRUB on the drive, and using it to load the
install CD's kernel) will work for most Linux install CDs. Sometimes it
doesn't work (or you will need to change some things) if the installer
does weird things like actually try to access the CD drive of the
computer, but I've never had any problems using it with a text
installer, and it nearly always works with regular graphical installs as
well. (Off the top of my head, I know that it doesn't work with the
Ubuntu live CD, I've tried it.)

I hope this helps!

-- Evan Klitzke

More information about the users mailing list