How to create multiboot USB with Linux - LinuxConfig.org


#1
Create a bootable usb device containing multiple Linux distributions.
This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-create-multiboot-usb-with-linux

#2

I got stuck at this step:

$ sudo grub2-install --target=x86_64-efi --recheck --removable --efi-directory="/media/efi" --boot-directory="/media/data/boot"

grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.

I am using Fedora 29, and grub2-efi is already installed. What am I missing?


#3

Thanks for pointing it out. You should also install the grub2-efi-modules package.
Probably this package was already installed on my system when I wrote the article, so I took it for granted. I will fix this and include it in the tutorial.


#4

Thanks. Installing “grub2-efi-x64-modules” fixed it.
However, after I booted, it reached to a grub prompt only and the menu did not appear. I did add three iso’s and searched and guessed their initial ram disk file. Is something missing in the grub.cfg?


#5

Would you mind sharing your grub.cfg file?


#6

Sure; here it is. And I noticed my error was missing the closing curly bracket. So I got the menu after adding that. But still none of the iso images worked since I got a vmlinuz error “…file ‘/isolinux/vmlinuz’ not found … you need to load the kernel first.” Now I need to check vmlinuz location in the iso image and update the file accordingly.

menuentry "Rescatux 0.51b3" {
    isofile="/boot/iso/rescatux-0.51b3.iso"
    loopback loop "${isofile}"
    linux (loop)/isolinux/vmlinuz iso-scan/filename="${isofile}" inst.stage2=hd:LABEL=Rescatux quiet
    initrd (loop)/live/initrd1.img

menuentry "System Rescue CD 5.3.2" {
    isofile="/boot/iso/systemrescuecd-x86-5.3.2.iso"
    loopback loop "${isofile}"
    linux (loop)/isolinux/vmlinuz iso-scan/filename="${isofile}" inst.stage2=hd:LABEL=SystemRescueCD quiet
    initrd (loop)/isolinux/initram.igz

menuentry "Trinity Rescue Kit 3.4 build 372" {
    isofile="/boot/iso/trinity-rescue-kit.3.4-build-372.iso"
    loopback loop "${isofile}"
    linux (loop)/isolinux/vmlinuz iso-scan/filename="${isofile}" inst.stage2=hd:LABEL=Trinity_Rescue_Kit quiet
    initrd (loop)/initrd.trk

#7

Rescatux and SystemRescueCD both have a /boot/grub/ directory with a config file in it. So it indicated the kernel and initial ramdisk locations. The TrinityRescueKit had the images and config files in the root directory.

Your tutorial was very well explained. Thanks.


#8

Thank you, I’m glad you found the tutorial useful. So, are you able to boot now?


#9

No. After selecting from Grub menu, I’m still not able to boot any of the images.
The errors are sometimes “…you need to load the kernel first”, or kernel panic. It seems the images don’t know the root directory.

This is the current grub.cfg file:

menuentry "Rescatux 0.51b3" {
    isofile="/boot/iso/rescatux-0.51b3.iso"
    loopback loop "${isofile}"
    linux (loop)/live/vmlinuz1 iso-scan/filename="${isofile}" inst.stage2=hd:LABEL=Rescatux quiet
    initrd (loop)/live/initrd1.img
}

menuentry "System Rescue CD 5.3.2" {
    isofile="/boot/iso/systemrescuecd-x86-5.3.2.iso"
    loopback loop "${isofile}"
    linux (loop)/isolinux/rescue64 iso-scan/filename="${isofile}" inst.stage2=hd:LABEL=SystemRescueCD quiet
    initrd (loop)/isolinux/initram.igz
}

menuentry "Trinity Rescue Kit 3.4 build 372" {
    isofile="/boot/iso/trinity-rescue-kit.3.4-build-372.iso"
    loopback loop "${isofile}"
    linux (loop)/kernel.trk iso-scan/filename="${isofile}" inst.stage2=hd:LABEL=Trinity_Rescue_Kit quiet
    initrd (loop)/initrd.trk
}

menuentry "CorePlus" {
    set isofile="/boot/iso/CorePlus-current.iso"
    loopback loop $isofile
    linux (loop)/vmlinuz iso-scan/filename=$isofile inst.stage2=hd:LABEL=CorePlus quiet
    initrd (loop)/boot/core.gz
}

menuentry "Sparky Linux" {
    set isofile="/boot/iso/sparkylinux-4.9.2-x86_64-minimalgui.iso"
    loopback loop $isofile
    linux (loop)/live/vmlinuz iso-scan/filename=$isofile inst.stage2=hd:LABEL=CorePlus quiet
    initrd (loop)/live/initrd.img
}

#10

Sorry for the late response, but I’ve been quite busy lately. For starters here is a working configuration for
Rescatux:

menuentry "Rescatux 0.51b3" {
    isofile="/boot/isos/rescatux-0.51b3.iso"
    loopback loop "${isofile}"
    linux (loop)/live/vmlinuz1 findiso="${isofile}" boot=live config quiet splash selinux=1 security=selinux enforcing=0 locales=en_US.UTF-8 live-config.nox11autologin
    initrd (loop)/live/initrd1.img
}

Basically what I replaced was “isoscan/filename” with “findiso”. The first is often used in Rhel family of distributions, and the second on Debian and Debian-based ones (Ubuntu, however seems to use the first one, so no guarantees). Please notice also that the inst.stage2 option is specific to Red hat distributions, is not a generic one: if you want more information about it, you can take a look here https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-anaconda-boot-options. I will test the others as soon as I can.


#11

Thanks for this guide.

Prefer having variable set isoPath=/boot/iso defined before any menuentry and reuse it in the isofile variable like isoFile=$isoPath/rescatux-0.51b3.iso such that all the menu entries refer single ISO path except where not necessary.