Booting several ISOs with GRUB2 on Fedora 34

Friendly greetings,

with GRUB2 I would like to boot several ISOs directly from harddisk.

My main drive with Fedora is a Kingston SA2000M8500G detected as /dev/nvme0n1 but strangely displayed by GRUB2 as (hd1). The data drive is a Seagate ST1000DM010-2EP102 detected as /dev/sda and displayed by GRUB2 as (hd0). The ISO files are then located on (hd0.gpt1) in “/iso/file_xy.iso”.

Then I put in the file /etc/grub.d/40_custom the following code:

menuentry "Fedora 34 with XFCE" {
insmod part_gpt
insmod linux
set isofile="/iso/Fedora-Xfce-Live-x86_64-34-1.2.iso"
export $isofile
loopback loop (hd0,gpt1)$isofile
linux (loop)/isolinux/vmlinuz root=live rd.live.image quiet iso-scan/filename=$isofile
initrd (loop)/isolinux/initrd.img
}

This leads to the GRUB2 error “our of memory”, followed by the 2 persisting errors (errors that showed up by previous mistakes aswell) “no server” and “load kernel first”. Previous mistakes that lead to the errors “unknown filesystem” and “invalid filename” could be fixed by trying settings from various websites, but now I am stuck. Most search results were dated from 2011 to 2014 and I assume the syntax in GRUB2 changed. Either way, it would be great if somebody could help me to get this started.

P.

1 Like

On Internet Search, some post said the ArchWiki works:

https://wiki.archlinux.org/title/Multiboot_USB_drive#Workstation_live_medium

1 Like

Yeah, $(Internet Search Result) number 25: I tried this forum, because I hoped that somebody would explain the error with the config I posted.

As I read from the ArchWiki, this extra section is needed:

insmod search_fs_uuid search --no-floppy --set=isopart --fs-uuid 123-456   
# later use inside each menuentry instead 
loopback loop ($isopart) $isofile`
1 Like

That was partialy successful. The “not found” and “unknown filesystem” typed errors are gone. But the 2 errors that were always present in line 2 and 3 persist:

  • no server is specified
  • you need to load kernel first
1 Like

The above is a similar topic.

However, when I try with Fedora 34 server, in the grub2 shell, the “probe” command is missing.

The next question from me, is what are the correct kernel parameters needed for Fedora livecds.

This example works for me
https://forums.fedoraforum.org/showthread.php?315348-Boot-live-iso-from-hdd&p=1793582#post1793582

I added this to section 40_custom of my grub.cfg

menuentry 'Live F34-i3'  {
	rmmod tpm
    set isolabel=F34-i3-x86_64
	set isofile="/iso/LiveCD.iso"
	loopback loop (hd0,gpt3)/$isofile
	set root=(loop)
	linuxefi /images/pxeboot/vmlinuz iso-scan/filename=$isofile root=live:CDLABEL=$isolabel ro rd.live.image
	initrdefi /images/pxeboot/initrd.img

}

2 Likes

please explain this line

From that thread, based on the hints and internet search results of example, I finally make it work with the configuration shown.

However, I did not manage to fully understand every line of that config.

I am sorry that I cannot further explain to you.

1 Like