Ubuntu – Multi-partition multi OS bootable USB

bootdual-bootgrub2live-usbpartitioning

I want to create a recovery flash drive. I have my 8 gb flash drive[Kingston data traveller] with me. I also have the required .iso files for a>Ubuntu 13.10 b>Boot-repair disk c>AVG Rescue CD

I Wish to create 4 partitions(3 for each bootable .iso and one for data storage. Also, I want a way in which I can select which OS to boot each time I boot from USB.

So, is there a way to install GRUB on USB as well as the three other live distros? And how to create such a setup?

Best Answer

I have not used MultiSystem, but that one I have seen recommended as well as several others. MultiBootUSB - Install and boot multiple Linux from Pendrive / Flash drive / USB disk w/grub2

https://help.ubuntu.com/community/InstallAndBootMultipleLinuxFromPendriveFlashDriveUSBDisk

See yumi for multi-boot versions

http://www.pendrivelinux.com/

But to understand it better you can just install grub2 to the flash drive, create your own grub.cfg with boot stanzas and copy ISO into flash drive. Very similar to a hard drive install like this link.

https://help.ubuntu.com/community/Grub2/ISOBoot

To install grub2 into a flash drive, default /media now varies depending on version. New version add the user to the path. Also assumes sdb as flash drive, confirm that is correct if not sure. Label partition - if label is grub2 & mount:

sudo grub-install --root-directory=/media/grub2 /dev/sdb

Newer versions automount with $USER name also, this one labeled MC4GB, with user fred

sudo grub-install --root-directory=/media/fred/MC4GB /dev/sdb

In creating grub.cfg, the boot drive is always hd0, so if directly booting from flash drive setting will be hd0,Y where Y is partition usually 1.

loopback loop (hd0,1)$isofile

Otherwise examples are like these:

https://help.ubuntu.com/community/Grub2/ISOBoot/Examples

First entry in my grub.cfg in MC4GB

set default=0 
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
set gfxpayload=800x600

menuentry "Ubuntu 13.04" {
set isofile="/boot/iso/ubuntu-13.04-desktop-amd64.iso"
loopback loop (hd0,1)$isofile
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile nomodeset 
initrd (loop)/casper/initrd.lz
}

menuentry " " {
set root= 
}

Note I added nomodeset to all entries as I have nVidia. Also new versions now use vmlinuz.efi for both BIOS & UEFI boot. Older versions were just vmlinuz. Other distributions may need different boot parameters. Find example in above example thread or mount and check what ISO has for its boot parameters.

Related Question