[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

usb memory stick booting w/ grub



Hi,

Syslinux does not work for me (as well as a few other people), for
memory stick booting (see #273453 for more details).  Instead, I ended up
using grub to boot from my memory stick.  Since people may be interested
in bypassing the syslinux/mbr dance, and/or may be more comfortable w/
grub, here's what I did:

1) If not already created, create a partition on the memory stick.  The
type doesn't matter (I left it at the default for linux, which is 0x83),
just make sure the bootable flag is toggled.  Format the partition, as
well (ext2 works perfectly well; mke2fs /dev/sda1 && tune2fs -m0
/dev/sda1). I'm not sure if grub supports vfat, so this procedure may not
be for you if you want to mount the contents of your memory stick in
windows.

2) Mount the partition (mount /dev/sda1 /mnt).

3) Install grub onto the stick's MBR (grub-install --root-directory=/mnt
/dev/sda).

4) Create a menu.lst for grub and copy it to the boot/grub directory
on the partition (cat >menu.lst<<EOF
default 0
timeout 5
color cyan/blue white/blue

title           Debian Installer
root            (hd0,0)
kernel          /vmlinuz ramdisk_size=10000 root=/dev/rd/0 init=/linuxrc devfs=mount,dall rw
initrd          /initrd.gz
savedefault
boot
EOF
cp menu.lst /mnt/boot/grub).

5) Copy the other necessary files over to the partition (cp initrd.gz
vmlinuz /mnt).

6) At this point, you should have a bootable usb stick.  Choose the image
you want to install, copy it over, and you're done.  I went with the
netinst CD image (cp sarge-i386-netinst.iso /mnt/sarge.iso).

7) Unmount the partition (umount /mnt).

It would be fairly trivial to script something to do this for people; the
only variables are the block device to mangle (ie, /dev/sda), how to
handle mangling it (ie, do you want to use the entire disk?), and which
image you want to use.






Reply to: