A script to create a simple bootable USB drive capable of booting more than one distro.
usage: multiso.sh [command]
commands:
- partition DEVICE .... partition device for multiso
- install DEVICE ...... install GRUB and multiso config on device
This script partitions the drive into a hybrid GPT / MBR partition scheme, with both x86_64-efi and i386-pc GRUB installed. The partitions created are:
- 1: BIOS boot partition (1M, for i386-pc GRUB)
- 2: EFI system partition (50M, for x86_64-efi GRUB, labeled "MULTEFI")
- 3: FAT32 data partition (rest, for ISOs and GRUB config, labeled "MULTISO")
To install multiso on a device /dev/sdX, you need to run the following
commands:
multiso.sh partition /dev/sdXOn devices with a broken or unrecognized partition table this might fail on first run. Rerun this command once, and it should go through without errors.multiso.sh install /dev/sdX
The partition label for the two partitions can be adjusted with the
MULTISO_ISO_LABEL and MULTISO_EFI_LABEL environment variables.
Just put your ISOs into the iso/ folder in the "MULTISO" partition. You will
need to adjust the configuration in grub/grub.cfg to add the correct menu
entry.
Since many distributions have very similar folder structure, you will often only need to specify the kernel and initramfs paths. For the first image with a particular structure, you will also have to add a "boot helper" function that sets the right kernel parameters. Here is an example configuration for Ubuntu:
# ISO boot helpers -------------------------------------------------------------
function iso_boot_ubuntu {
linux $linux_path iso-scan/filename="$iso_file" file=/cdrom/preseed/ubuntu.seed maybe-ubiquity fsck.mode=skip $linux_options
}
# ISO menu entries -------------------------------------------------------------
set iso_name=ubuntu-22.04.1
set linux_path=/casper/vmlinuz
set initrd_path=/casper/initrd
set intel_ucode_path=
set amd_ucode_path=
iso_menuentry iso_boot_ubuntu
# ------------------------------------------------------------------------------
Distros supported by the default grub configuration:
- Arch Linux
- Manjaro
- Fedora (currently non-working)
- Ubuntu (24.04 too big for FAT)
- Linux Mint
- Debian (currently non-working)
This script needs the following programs to work:
sudosgdiskpartprobemkfs.fatmountumountgrub-installmktemp