Multi-partition multi OS bootable USB

For me the best tool to create a Multi-OS live USB is MultiSystem which can be found here. There are many Operating Systems that can be installed via MultiSystem. And you can easily install it on Ubuntu using the project's official repo:

sudo apt-add-repository 'deb http://liveusb.info/multisystem/depot all main' 
wget -q -O - http://liveusb.info/multisystem/depot/multisystem.asc | sudo apt-key add - 

sudo apt-get update 
sudo apt-get install multisystem

Although the site is in French, it's translated into English very satisfactorily via a "Google Translate" powered dropdown list box on the right column (or directly by Google Chrome) but you can also make use of the step-by-step instructions here.

As for your setup, you can initially create 2 partitions using GParted before starting MultiSystem:

  1. 4GB FAT32 partition for MultiSystem, including ISO files, etc. and a blank persistent file to store Ubuntu settings, etc., which can be created in MultiSystem later.

  2. 4GB NTFS partition for Data.


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.


Here is a menuentry for booting an iso on the second partition of a multiboot flash drive, (as suggested to me by sudodus).

menuentry "ubuntu-12.04-desktop-i386 Partition 2" {
    set isofile="/ubuntu-12.04-desktop-i386.iso"
    set root='(/dev/sda,msdos2)'
    search --no-floppy --fs-uuid --set=root XXXX-XXXX
    loopback loop ($root)$isofile
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
    initrd (loop)/casper/initrd.lz
}

Substitute your second, third & forth partition's UUID for XXXX-XXXX The menuentrys for Boot-repair disk & AVG Rescue CD may have different form than Ubuntu. MultiBootUSB script should tell you how to write these.


Multi-Boot Full System install

The size of flash drives has increased since this question was first asked. It is now quite reasonable to make a multi boot drive using Full system installs.

Full installs are more stable and secure than persistent installs, but not as quick to make. They are better at utilizing disk space as no fixed size casper-rw file or partition is required. They are not much use at installing an OS, for installing an OS booting an ISO works fine.

  • Using GParted create GPT partition table on large flash drive.

  • Make as many ext4 partitions as you have OS. Size should be about 8GB each or larger.

  • Boot Live drive in UEFI mode and insert large target drive.

  • At partitioning selected "Something else".

  • Choose sdc1 for /.

  • Install bootloader to root of the USB drive.

  • Leave all other partition's format boxes unchecked.

  • Install choosing encryption of home directory if desired, Full disk encryption does not work for me on flash drive.

  • Repeat this with sdc2, sdc3, etc, and the OS's you choose to install.

  • After the last install boot the flash drive and do an update-grub. This will add all the OS to grub.cfg

You can leave a partition for any ISO's you wish to Live boot or persistent boot, to make an installer flash drive, loop mount these using grub.cfg.