diff options
| author | Ahmed Abdelhalim <[email protected]> | 2024-09-03 00:47:56 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2024-09-03 00:49:03 +0200 |
| commit | 03963aecd43a559f1ec18e30cef5f802aeafd251 (patch) | |
| tree | e8b167579ff8c888a0148fc77e8ac4369539aa40 /content/blog | |
| parent | 664d6f330b6c78f82afb5a457b0205cb4003a265 (diff) | |
Add new blog post about multi-distro linux usb
Diffstat (limited to 'content/blog')
| -rw-r--r-- | content/blog/multi-distro-usb.md | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/content/blog/multi-distro-usb.md b/content/blog/multi-distro-usb.md new file mode 100644 index 0000000..7b25019 --- /dev/null +++ b/content/blog/multi-distro-usb.md @@ -0,0 +1,68 @@ +--- +title: Multi Distro Linux USB +date: 2024-09-02 +draft: false +--- + +I 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 specific purpose, +like using [Tails][1] Linux to generate/restore a PGP key and install it on the smart card, +or using [ParrotSec][2] for testing or [HTB][3] challenges. + +I know it was possible to create a hard drive with multiple OS in different partitions, so +I thought, it has to be possible to do the same thing using a USB drive. + + +# How to create multi-distro bootable Linux stick +Unless you are into [GRUB][8], 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 some 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 to anything else. + +Tools like [glim][5] (which is amazing btw), and [uGRUB][6] only work with a single `fat32` partition. + +Tutorials like [this][4] (which is amazing btw and mentioning how to work with multi-partition USB sticks, +including with `ext4`), works 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 work on +**only** one of my machines (the old one that have 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... + +[Glim][7] + +## 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 is +the required parameters to run proxmox linux. + +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, and why it couldn't insert `thinkpad_acpi' module, +but for the original purpose of having a convinient way of setting up linux and updating images, +I will stick with having to run +```bash +$ 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 few minutes, for now. + +[1]: https://tails.net/ +[2]: https://parrotsec.org/ +[3]: https://www.hackthebox.com/ +[4]: https://linuxconfig.org/how-to-create-multiboot-usb-with-linux +[5]: https://github.com/thias/glim +[6]: https://github.com/adi1090x/uGRUB/ +[7]: https://github.com/thias/glim?tab=readme-ov-file#troubleshooting +[8]: https://www.gnu.org/software/grub/ |
