Boot Multiple ISO from USB via GRUB2

Boot Multiple ISO from USB using GRUB2 from Linux. Here is one way to manually create a Multiboot USB Flash Drive (Multiboot ISOs) from a running Linux environment. Allowing you to store and run Multiple ISO files from one single USB drive.

More Grub2 Bootable ISO files will be added to the grub.cfg file as I find time to test them. Contact me to submit your working Bootable Linux ISO grub.cfg entries for inclusion.

UPDATE: There is now an updated method to boot Multiple ISO from USB from an exFAT formatted flash drive. <- This method includes a grub.cfg that makes it possible to simply drag and drop ISO files onto the USB drive and then boot from them.

If you have access to a Windows machine, the YUMI – exFAT Multiboot USB Maker Software Tool completely automates this process.

Eventually you might find the need to pick up a larger external storage device in order to include every bootable ISO entry. Here are some of the Fastest USB flash drives that I personally use and recommend.

How to Boot Multiple ISO from USB using GRUB2

I. Format a USB Flash Drive to use a Single Partition

The following assumes you are already up and running from a Linux desktop with your flash drive plugged in. Ubuntu was used for this tutorial. Most Debian based systems will also work.

1. First you need to open a terminal. To do this press ctrl+alt+t
2. To gain root access, type the following and then press Enter.

sudo su

3. Next, to find out which device belongs to your usb, type

fdisk -l

4. Note which device belongs to your usb flash drive.
Use fdisk -l to locate usb device - Boot Multiple ISO from USB
5. Now you need to allow fdisk to access the device.
To allow fdisk access to modify the device, type the following (making sure to replace x with your actual usb device).

fdisk /dev/sdx

WARNING any data on the partition will be wiped clean in step 6.
6. Next, type d (to delete the existing partition)
7. Then, type n (to create a new partition)
8. Type p (for primary partition)
9. Type 1 (to create the first partition)
10. Press Enter (to use the first cylinder)
11. Press Enter again (to use the default value as the last cylinder)
12. Type a (to mark the first partition active "bootable")
13. Type t (for partition type)
14. Type c (to use fat32 partition)
15. Type w (to write the changes and close fdisk)

II. Create a Fat32 Filesystem on a USB Flash Drive

For the following steps, replace x with your usb device.

1. First, you might have to unmount the mounted partition (it may or may not be mounted). To unmount, type the following and press Enter.

umount /dev/sdx1

2. Then to format the partition as fat32, type

mkfs.vfat -F 32 -n MULTIBOOT /dev/sdx1

III. Install Grub2 on a USB Flash Drive

Important Note:
Old versions of grub used --root-directory=/mnt/USB
while current versions use --boot-directory=/mnt/USB/boot

If you use the wrong syntax, you will receive an error stating "Installation is impossible. Aborting"

Again, for the following steps replace x with your actual usb device.

1. First, you need to remount your usb device partition to make it accessible to Grub for install.

To remount the partition, type

mkdir /mnt/USB && mount /dev/sdx1 /mnt/USB

2. Next, use ONE of the steps below to install Grub2 on the USB device.
a.) If Grub2 64 bit UEFI x86_64-efi is used on the Linux host, then type

grub-install --force --removable --no-floppy --target=x86_64-efi --boot-directory=/mnt/USB/boot --efi-directory=/mnt/USB

b.) If Grub2 32 bit UEFI i386-efi is used on the Linux host, then type

grub-install --force --removable --no-floppy --target=i386-efi --boot-directory=/mnt/USB/boot --efi-directory=/mnt/USB

c.) If Grub2 BIOS i386-pc is used on the Linux host, then type

grub-install --force --removable --no-floppy --target=i386-pc --boot-directory=/mnt/USB/boot /dev/sdx

3. Then you want to change to the grub directory so that you can add a configuration file.
To change to the grub directory, type

cd /mnt/USB/boot/grub

4. Finally, to download a Multiboot ISO grub2 configuration file, type

wget pendrivelinux.com/downloads/multibootlinux/grub.cfg

This example configuration uses grub2 loopback mounting for the ISO files.↑

IV. Adding Bootable ISO files to USB

1. First, you want to change to the root directory of your USB.

This step assumes your USB is still mounted... else repeat section III. (part 1)

To change to the root directory of the mounted USB, type

cd /mnt/USB

2. Next, from the tabs below, simply follow the instructions for each ISO Distro you would like to add to make bootable from USB.

For USB Ubuntu, type the following in the terminal, and press Enter.

wget "http://releases.ubuntu.com/groovy/ubuntu-20.10-desktop-amd64.iso" -O ubuntu.iso

Alternately you can rename an existing ISO to ubuntu.iso and copy it to the USB device.

For USB Debian Live, type the following in the terminal, and press Enter.

wget "https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-10.6.0-amd64-gnome.iso" -O debian.iso

For USB Linux Mint, type the following in the terminal, and press Enter.

wget "http://mirrors.gigenet.com/linuxmint/iso/stable/20/linuxmint-20-cinnamon-64bit.iso" -O linuxmint.iso

Or rename your existing ISO to linuxmint.iso and copy it to your drive.

For USB dban, type the following in the terminal, and press Enter.

wget "downloads.sourceforge.net/project/dban/dban/dban-2.3.0/dban-2.3.0_i586.iso" -O dban.iso

Or rename your existing ISO to dban.iso and copy it to your flashdrive.

For USB TinyCore, type the following in the terminal, and press Enter.

wget "distro.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/release/tinycore-current.iso" -O tinycore.iso

Or rename your existing ISO to tinycore.iso and copy it to your external drive.

For MemTest86+, type the following in the terminal, and press Enter.

wget memtest.org/download/5.31b/memtest86+-5.31b.bin.zip

To unzip, type the following in the terminal, and press Enter.

unzip memtest86+-5.31b.bin.zip

Then to copy, type the following in the terminal, and press Enter.

cp memtest86+-5.31b.bin memtest86+.bin

Or extract the contents of your existing memtest86+ zip file. Rename the bin to memtest86+.bin and copy it to your USB device

Adding an Unlisted ISO: To try ISO Files that are not yet listed, use the existing menuentry examples in /boot/grub/grub.cfg and append any options normally found in the distributions syslinux.cfg file on the "append" line to the "linux" line of the menu entry.

Please inform me of entries you get to work and I will add them to the list, so that others may benefit as well.

V. Test that your computer can Boot Multiple ISO from USB

Reboot your Computer, and enter your BIOS or Boot Menu. Set the Boot Order to boot from the USB Device. Save your changes and then Reboot.

If all went well, you should be presented with a Grub2 Boot Menu containing the USB bootable entries you previously added. Concluding How to create a Multiboot USB which can be used to Boot Multiple ISO from USB.