Saturday, July 7, 2012

Multi Boot Pendrive (Grub on USB)

Boot ISO Files directly from USB using Grub2 from Linux. Here is one way to create a Multiboot USB Flash Drive from a running Ubuntu (I used the Live CD). You may eventually need a large Flash Drive or USB Hard Drive in order to include every bootable ISO entry. I will add more Bootable ISO files to the grub.cfg file as I find time to test them. Contact me to submit working Bootable Linux ISO grub.cfg entries for inclusion.
I. Format your USB Flash Drive to use a Single Partition:
Open a terminal and type sudo su
Type fdisk -l (and note which device is your USB Drive)
Type fdisk /dev/sdx (replacing x with your actual usb device)
Type d (to delete the existing partition)
Type n (to create a new partition)
Type p (for primary partition)
Type 1 (to create the first partition)
Press Enter (to use the first cylinder)
Press Enter again (to use the default value as the last cylinder)
Type a (for active)
Type 1 (to mark the first partition active “bootable”)
Type w (to write the changes and close fdisk)
II. Create a Fat32 Filesystem on the USB Flash Drive:
Type umount /dev/sdx1 (to unmount the mounted partition)
Type mkfs.vfat -F 32 -n MULTIBOOT /dev/sdx1 (to format the partition as fat32)
III. Install Grub2 on the USB Flash Drive:
Type mkdir /media/MULTIBOOT (to create a directory for the mountpoint)
Type mount /dev/sdx1 /media/MULTIBOOT (to mount the USB)
Type grub-install –force –no-floppy –root-directory=/media/MULTIBOOT /dev/sdx (to install Grub2)
Type cd /media/MULTIBOOT/boot/grub (to change directory)
Type wget (to get the grub.cfg file)
IV. Test to make sure your USB Device Boots into Grub2:
Reboot your Computer, and enter your BIOS or Boot Menu. Set the Boot Order to boot from the USB Device. Save your changes and Reboot. If all goes well, you should be presented with a Grub2 Boot Menu.
V. Adding the Bootable ISO files:
Type cd /media/MULTIBOOT (assuming USB is still mounted here)
Follow the instructions for the ISO Distro you would like to add below. Simply click to expand the instructions.
Ubuntu 10.10 IS0
Type wget “” -O ubuntu.iso
Or rename your existing ISO ubuntu.iso and copy it to the USB device
Linux Mint 10 Gnome IS0
Type wget -O linuxmint10.iso
Or rename your existing ISO linuxmint10.iso and copy it to the USB device
Type wget “” -O dban.iso
Or rename your existing ISO dban.iso and copy it to the USB device
TinyCore IS0
Type wget “” -O tinycore.iso
Or rename your exisitng ISO tinycore.iso and copy it to your USB device
Type wget
Type unzip
Type cp memtest86+-4.10.bin memtest86+.bin
Or extract the contents of your memtest86+ zip. Rename the bin to memtest86+.bin and copy it to your USB device

No comments:

Post a Comment