====== Creating a multi-boot USB stick ======
It's been a very long time since you had to use a CD-Rom to install an Operating System from. These days you can simply copy the ISO image onto a CD-Rom or a USB stick, boot from it, and install the system.
ISO images are either smaller than a CD-Rom (680 Mbytes), for example the current (2026-03-01) Devuan Excalibur net installer image is 594 Mbytes, or at least smaller than a DVD-RW (4.7 Gbytes) for a full (no Internet connection required) installer.
USB sticks are commonly **much** larger than that these days, so it seems rather wasteful to have even (small) 8 Gbyte USB sticks each containing only 600 Mbytes of data, for installing whichever system you've put onto it.
Therefore it makes sense to have a method for putting multiple images onto a single USB stick, and then be able to select which one you want to use at boot time.
[[https://pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/|Pendrive Linux]] claims to show you how to do this, but I encountered several problems when I tried to follow those instructions, therefore this page now exists, showing how I got it to work for me.
**NOTE: FOR THE TIME BEING, THESE INSTRUCTIONS ARE INCOMPLETE AND DO NOT WORK**
Just to be clear, these instructions have been tested on a Devuan Daedalus system using grub-pc (ie: "standard" Bios booting, not UEFI), with Grub 2.06. The Pendrive Linux page discusses how to get things working for UEFI booting as well, so if you need that, refer to the above page for the additional information.
===== Create one partition on the USB stick =====
This process requires just one partition to exist on the USB stick; all files, including however many ISO images you want to be able to boot from, live inside this single partition.
If you're not familiar with ''fdisk'', or with finding out the name of the USB stick once it's plugged in to your machine, these instructions are probably not for you.
You want to create a single FAT32 on the USB stick (and for good measure, make it bootable, although I'm pretty sure I have never come across any machine which pays attention to the bootable flag).
Once the partition is created, format it (as FAT 32 of course):
mkfs.vfat -F 32 -n MultiBoot /dev/sdX1
===== Mount the formatted partition and set up some files in it =====
Make sure nothing is mounted under /mnt and then:mount /dev/sdX1 /mnt
Install Grub2 onto the device and create its support files in the file system:grub-install --force --removable --no-floppy --target=i386-pc --boot-directory=/mnt/boot /dev/sdX
Then create the Grub configuration file which tells it what images are available and how to boot them.
Use your favourite text editor to create the file:GRUB_TERMINAL=console
set gfxmode=auto
set gfxpayload=keep
insmod all_video
insmod gfxterm
insmod part_msdos
insmod part_gpt
insmod regexp
terminal_output gfxterm
set timeout=60
set default=0
if [ -e (${bootdev},msdos1)/*.* ]
then
for isofile in (${bootdev},msdos1)/*.*
do
regexp --set=isoname "/(.*.*)" "${isofile}"
export isoname
regexp --set=1:ext '^.*\.(.*$)' "${isoname}"
if regexp '^[iI][sS][oO]$' "${ext}"
then
menuentry ${isoname} {
set iso_path="(${bootdev},msdos1)/${1}"
export iso_path
if [ "$grub_platform" = "efi" ]
then
map -f "${iso_path}"
partnew -t 0 -s 0 -l 0 (${bootdev}) 3
partnew --type=0x00 --file="${iso_path}" (${bootdev}) 3
set root=(vd0)
_config
fi
}
fi
done
fi
----
[[.:|Go up]]\\
Return to [[:|main index]].