Forum Discussion
How to boot multiple operating systems on one usb drive?
GRUB2 (GRand Unified Bootloader version 2) is a widely used, open-source bootloader that can load multiple operating systems, kernels, and recovery tools. It's highly configurable and supports a variety of file systems and boot methods. Using GRUB2 as a custom bootloader to boot multiple operating systems on USB is a powerful and flexible approach, especially if you want granular control over the boot process.
Setting up GRUB2 for boot multiple operating systems on USB
1. Prepare the USB drive
Format the drive with a compatible file system (typically FAT32 or NTFS).
Install a minimal Linux system or a dedicated bootloader setup.
2. Install GRUB2
Use a Linux system to install GRUB2 onto the USB drive.
This involves installing the bootloader and creating a grub.cfg configuration file.
3. Organize your OS images
Copy your ISO images (Windows, Linux distros, recovery tools) into the USB drive into a directory, such as /boot/isos/.
4. Configure grub.cfg
Create entries for each OS, specifying kernel, initrd, or ISO files.
For example, for booting Linux ISOs:
menuentry "Ubuntu 20.04" {
set iso_path="/boot/isos/ubuntu-20.04.iso"
loopback loop $iso_path
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$iso_path quiet splash
initrd (loop)/casper/initrd.lz
}
For Windows or other images, additional configuration or tools may be needed.
5. Boot from the USB
Insert the USB into the target PC.
Select the USB as boot device.
GRUB2 presents a menu of OS options based on your configuration.