Installing Grub 2 on a USB flash drive

MultiBootISOs is a tool that let you install Grub on a USB flash drive. I really like it because it lets me boot from ISO files and let me put a bunch of ISOs on my USB and choose which one to boot.
The problem is, this is a Windows tool, and I don't know how to do it through the command lines. I would also like to know how to install Grub (2) this way, Grub Legacy seems to be easier...
EDIT: I'm not asking for a tool (and definitely not a Windows tool). I want to know the commands that I have to execute to have the same effects. I'm having Ubuntu in my mind right now, but if there is a general way that I can boot any ISO in the USB then that would be better.


ANSWER:-

You got me curious how this would be done. The Pendrivelinux site had a tutorial I did this from my Mint 9 install instead of a live cd as the site suggests.
I started with finding the location of my USB drive in a terminal I ran df it returned the location of the device as
/dev/sdg1   /media/LINUXUSB
after that I ran
sudo su
and then to install grub 2
grub-install --no-floppy --force --root-directory=/media/LINUXUSB /dev/sdg1
I had to use --force additionally, the example on the site did not. Then I did
cd /media/LINUXUSB/boot/grub
The site gave a link to download a copy of grub.cfg to the /boot/grub directory on my USB drive. The link was
wget http://pendrivelinux.com/downloads/grub.cfg
After that I edited grub.cfg to reflect the iso's on my USB drive.
set timeout=10 set default=0

menuentry "Run Fedora" {
    loopback loop /Fedora13.iso
    linux (loop)/isolinux/vmlinuz0 boot=isolinux iso-scan/filename=/Fedora13.iso splash --
    initrd (loop)/isolinux/initrd0.img
}

menuentry "Run Ubuntu" {
    loopback loop /ubuntu-10.04-netbook-i386.iso 
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-10.04-netbook-i386.iso splash --
    initrd (loop)/casper/initrd.lz
}

menuentry "Run Clonezilla" {
    loopback loop /clonezilla.iso
    linux (loop)/live/vmlinuz boot=live iso-scan/filename=/clonezilla.iso splash --
    initrd (loop)/live/initrd.img }
I found that in the different iso's, vmlinuz and initrd were located in a different directory. I was able to get all three to start the boot process; but, only Ubuntu to actually load. If I figure out what I need to get the other two to finish loading, I will add that later. I have not tried any other iso's just these three.

0 comments:

Post a Comment

Don't Forget to comment