Glad to have helped. But now, I am not sure how.
The following would raise an error along the lines, “mount point (/mnt/boot/efi) does not exist”:
Well, okay.
That seems to contradict your comment (in post #3 above), that the boot partition is mounted at “/boot/efi”.
My guess, at this stage, is that you installed Leap 15.1 for legacy BIOS booting and you then installed Tumbleweed for UEFI booting. And your BIOS prefers UEFI if it has a choice.
I guess this is minor and IIRC I got around it by first creating the path: “mkdir /mnt/boot/efi”.
That was a good decision.
So now, I think you have converted 15.1 to use UEFI booting. But perhaps that leaves an inconsistency. It may be booting with UEFI, but parts of the system still think it is using legacy booting. That can be fixed, but for now I’ll just mention. I don’t want this reply to be too long.
**2. **I ran your code from inside a Live CD. After running it, I was able to boot into my good old Leap. There was also a menu entry for Tumbleweed, but it wouldn’t boot and would throw an error about “You have to load the kernel module first.” Not sure why.
I solved this one by booting into Leap and running Boot Loader (present in YAST) from inside there.
Okay. That may have already fixed the possible inconsistency that I mentioned.
**4. **Why should this whole issue happen? Previously, I had tried dual booting openSUSE Leap with Debian and Ubuntu and there were no such problems at all.
It happens because Leap 15.1 and Tumbleweed are both opensuse. So they both store their boot files in “/boot/efi/EFI/opensuse”. They use the same directory, and what one writes will overwrite the other.
When you use “ubuntu”, it uses a directory named “ubuntu”. And when you use “debian”, it uses a directory name “debian” (or maybe named “grub”). So you don’t have one overwriting the other.
It seems this is related to both Tumbleweed and Leap using the same name “opensuse” in /boot/efi/EFI/. If so, shouldn’t there be a bug report or something to solve the problem fundamentally?
There have been bug reports. It is far from clear what to do about it. You will actually run into the same problem if you install both “ubuntu” and “kubuntu”, or even if you install both “ubuntu” and “deepin” (because “deepin” uses the ubuntu booting, even though otherwise debian based).
It is possible to have different directory names – say “opensuse” for Leap 15.1 and “tumbleweed” for Tumbleweed. We can further discuss that below if you like. But it isn’t a perfect solution either.
On that “/etc/grub.d/40_custom”, here’s what I am currently using:
### Entry to boot openSUSE Tumbleweed on sdb2
menuentry "configfile for openSUSE Tumbleweed on /dev/sdb2" {
search --fs-uuid --set=bootdir b76c6bf4-772c-4419-8398-c5de5a538235
configfile (${bootdir})/grub2/grub.cfg
}
Note that this is appended to the header information already in that file.
Note that I use a separate “/boot” for Tumbleweed, and the UUID given is for that “/boot” partition. If you are not using a separate “/boot”, then you need the UUID of the Tumbleweed root file system (“/dev/mapper/something”), and you will need to replace the “/grub2/grub.cfg” with “/boot/grub2/grub.cfg”.