add Ubuntu too bootloader

Hello

I have another HDD in my system with Ubuntu installed on it and i would like to update Opensuse’s boot loader to find and start Ubuntu, However Update Grub commands have failed to be successful.

The Ubuntu root partition in encrypted however the other drive as its own GRUB2 loader that works, so i am at least trying to have the opensuse grub chain load GRUB2 for ubuntu.

Any help would be appreciated
Thanks!

If you can mount the partition
Then run

grub2-mkconfig -o /boot/grub2/grub.cfg

Also seem to be a problem if one is EFI boot and the other is MBR boot. But in you case it is probably the encryption causing the confusion

This is what I am doing to load another opensuse. You can try adapting it.


### Entry to boot opensuse_alt on sdc1
menuentry "configfile for linux on /dev/sdc1"  {
        set bootdir='hd3,gpt1'
        search --fs-uuid --set=bootdir cb44c7f1-143f-41ee-b24d-034a528ca6d2
        configfile (${bootdir})/boot/grub2/grub.cfg
}

The “hd3” is my guess for the disk (it changes depending on what USB drives are connected). The “gpt1” refers to partition 1 with GPT partitioning. Change that to “msdos1” for partition1 with traditional MBR partitioning. And it probably doesn’t matter if you get that wrong.

It’s the “search” line that does the work. It finds the partition with the given UUID, and assigns that to “bootdir”. You need to find the partition with “/boot” in Ubuntu. Use the “blkid” command to find its UUID, and replace the string I have with that.

The “configfile” directive then loads that boot menu. But the path I gave will be wrong. For one thing, ubuntu uses “/boot/grub” rather than “/boot/grub2”. And if “/boot” is a partition, then you will want just “/grub/grub.cfg”. It is the path relative to the partition of the given UUID.

I have used this method to boot ubuntu. I copied those lines from “/boot/grub2/grub.cfg”. But it is better to put them in “/etc/grub.d/40_custom” so that they will be automatically included.