I tried to be smart and set up a triple boot system (using EFI) with Fedora (mbr/primary guid), Windows 10 and openSUSE, using only Fedora’s GRUB. So when installing openSUSE I didn’t specify any ESP i.e. /boot/efi and only created a partition for root. O:)
My question is: How should I go about creating the right initframs & GRUB entry to be able to boot on openSUSE from Fedora’s GRUB?
I’d like to avoid reinstalling any OS if possible…
It would have been easier to just use the same ESP (use the expert partitioner during boot, and set that to mount at “/boot/efi”.
It’s not completely clear what you did.
If you are using secure-boot, you probably need to disable that. When booting with Fedora, with secure-boot the kernel would need to be signed by the fedora signing cert. So turning off secure-boot avoids that problem.
You can possibly add something like this to the Fedora grub.cfg (or whatever file you use to customize):
Notes: The “insmod btrfs” assumes that you are using “btrfs” for the openSUSE root file system. If you are using a different file system, change as needed.
Use the actual UUID of the root file system, not the made-up string that I put there. You can get the UUID with the “blkid” command.
This does assume that there is a symlink for “vmlinuz” and for “initrd” (this is usually the case with openSUSE).
Installed openSUSE making sure /boot/efi was not touched at all by the installer, and didn’t install any bootloader. i only installed openSUSE at / mount point, on its own partition.
If you are using secure-boot, you probably need to disable that.
Yup did already!
You can possibly add something like this to the Fedora grub.cfg (or whatever file you use to customize):
Notes: The “insmod btrfs” assumes that you are using “btrfs” for the openSUSE root file system. If you are using a different file system, change as needed.
Use the actual UUID of the root file system, not the made-up string that I put there. You can get the UUID with the “blkid” command.
This does assume that there is a symlink for “vmlinuz” and for “initrd” (this is usually the case with openSUSE).
Excellent, will try this out. Just to be sure: these symlinks for vmlinuz and initrd are supposed to be generated by… what? Fedora? Because as I said above I didn’t touch /boot, so there is no way these symlinks were created by openSUSE’s installer… So how to generate them?
They should already be there. Just check to be sure.
When a kernel is installed in openSUSE, those symlinks are created for the most recently installed kernel.
You could, of course, use the complete kernel path instead of the symlink. But then you would have to update it for every kernel update on openSUSE. By using the symlink, you make sure that you are always using the most recently installed kernel.
which is hardly surprising because the only kernel image I have a symlink to is Fedora’s. How may I generate a kernel image for openSUSE, bearing in mind I have opted out from installing any bootloader when installing openSUSE?
If this is too tall an order, I think I will simply reinstall openSUSE. But then, my question becomes: What is the best practice for installing openSUSE making sure (i) openSUSE bootloader is not written into MBT and (ii) making sure that the other main Linux distro (i.e. Fedora) keeps responsibility for maintaining everything GRUB-related? I’ve read openSUSE’s docs but this scenario is not described at all.
Look, I really appreciate your help but I think I am taking a large detour (my fault: I’ve started with too strong an assumption when I said that I didn’t want any openSUSE bootloader). Instead the best scenario for me would be to simply reinstall openSUSE while making sure Fedora’s GRUB is always handled control first at boot. For that, installing openSUSE with recommanded settings (writing files at /boot/efi in my case) and then running grub2-mkconfig -o FEDORA-EFI-DIRECTORY and then making sure efibootmgr assigns the highest priority to Fedora’s EFI would do it, no?
It will give you a choice – start with proposed partitioning or start with the original partition. Go with the original partitioning (what’s on the disk).
Set the opensuse root partition to be mounted at “/” and to be formatted.
Set any swap partition to be mounted as swap (but don’t format).
Set your EFI partition to be mounted at “/boot/efi”.
If your EFI partition is smaller than 250M, the installer will complain. Ignore the complaint and continue anyway.
Yes, this will probably put openSUSE first in boot order. But it should leave an entry for booting Fedora. You can change the boot order later. But running “grub2-mkconfig” is not the right way to change the boot order. You can boot to Fedora and reinstall grub2 there for that (probably “grub2-install” in fedora). Or you can use “efibootmgr -o” to set the boot order. And your BIOS might also have an option for that.
I do something similar here, except that I mostly use “configfile” rather than “chainloader”. Actually, “configfile” for systems that boot with “grub2”, and “chainloader” for systems that use some other means of booting.
However, to use this method you do need to install booting on each system. The OP had not done that.
Sure. But by default each system does exactly that and most of the time it works perfectly. efibootmgr allows to modify bootorder. Thus the machine will always boot your default system. You may boot another system by selecting the appropriate menu entry of the default system.
To summarize:
All systems have os-prober turned off
The primary system uses chain loading for booting secondary systems
The secondary systems don’t use chain loading
As all systems use only their native entry success is almost guaranteed.