I have often found myself needing to create a bootable USB stick with some Linux distro, either to install and try it, or to use it live for a specific purpose. Like using Tails Linux to generate or restore a PGP key and install it on the smart card, or using ParrotSec for testing or HTB/OTW challenges.
I knew it was possible to create a hard drive with multiple OS in different partitions, so I thought it had to be possible to do the same thing using a USB drive.
How to create a multi-distro bootable Linux stick
Unless you are into GRUB and want to learn more about it and feel more comfortable fixing GRUB issues by yourself,
Don’t.
After spending days looking into the grub configurations for running Rocky Linux and Proxmox (to no avail), I’m going to save you a deep rabbit hole dive.
Short answer, if you will only work with images less than 4GB, then it can(*) work, but if you are going to work with bigger images that you need live (Parrot Security 6+GB), it won’t work.
Long answer, I didn’t find a lot of info online on how to create a multi-partition multi-boot USB stick,
with the efi
“boot” partition formatted as fat32
and the “data/iso” partition formatted as anything else.
Tools like glim and uGRUB only work with a single fat32
partition.
Tutorials like this -which is amazing btw and explains in details how to work with multi-partition USB sticks,
including with ext4
- work too, But never stable enough.
I have seen the same setup randomly failing while being used in live mode. I have seen the same image works on only one of my machines (the old one that has an HDD) and fails on the others machines.
To quote the documentation:
If you have any problem to boot, for instance stuck at the GRUB prompt before the menu, try re-installing. If you have other exotic GRUB errors, such as garbage text read instead of the configuration directives, try re-formatting your USB memory from scratch. I’ve seen weird things happen…
Why?
At this point, I can’t tell you why an image would work or not. I can’t tell you how to boot Rocky Linux or what the required parameters to run Proxmox Linux are.
All I can tell you is that it took me way too long to figure out that it’s not stable enough to run reliably.
There might be a reason why it fails on the machine with the SSD or why it couldn’t insert the thinkpad_acpi
module,
but for the original purpose of having a convenient way of setting up Linux and updating images,
I will stick with having to run
$ diskutil list
$ diskutil eraseDisk JHFS+ Untitled /dev/diskX
$ diskutil unmountDisk /dev/diskX
$ sudo dd bs=4M if=path/to/image.iso of=/dev/diskX status=progress oflag=sync
and waiting for a few minutes, for now.