Hi,
This is a bit of a long story. I felt like installing Fedora Rawhide on my PC (read through this part; I am not here to ask for help with Fedora, more with the aftermath of me installing it), so I created a live USB for it using the 20180904 workstation live ISO and the dd command, to be precise I ran:
dd if=/path/to/iso of=/dev/sdc bs=4M status=progress && sync
then I rebooted. Usually when I reboot with a live USB inserted, press F9 (to show the Boot Manager, which lists available bootloaders; don’t confuse the Boot Manager with bootloaders like GRUB!), I see two USB-related options, one involves booting the USB in UEFI mode (with efivars loaded and alike), the other in normal mode. This was true with the Rawhide USB, I chose the UEFI mode initially, but it gave me:
https://imgur.com/FfHqnE8.png
(sorry for poor picture clarity; this image I’ll refer to as Figure 1). After this I naturally choose to boot the USB normally. Then I installed it, which went without hitch except it couldn’t install the bootloader (probably because I forced it to use my EFI partition, the default was to create a BIOS boot partition and non-UEFI /boot partition). I didn’t worry about the bootloader as I thought, “Well I can create a bootloader entry for it using GRUB installed by my other distros.” Then I rebooted, took the live USB out, pressed F9 and found this (which I’ll refer to as Figure 2):
https://imgur.com/irSGIWa.png
. This really surprised me and irritated me because there used to be bootloaders belonging to the distros I had installed like Fedora, Arch Linux, openSUSE Tumbleweed, etc. listed here. What I did now was boot up my Fedora Rawhide live USB (which given I wasn’t running it in UEFI mode meant I couldn’t do anything with efibootmgr) and create a live USB for Zorin OS. Why Zorin? It has out-of-the-box support for my BCM4352 WiFi chip for starters, secondly I know its UEFI live session is nice and stable (and not likely to give me the error Rawhide did when I booted it in UEFI mode). What I did then was I ran (as root):
mkdir /tumbleweed
mount /dev/sda8 /tumbleweed
mount /dev/sda1 /tumbleweed/boot/efi # My ESP
mount /dev/sdb1 /tumbleweed/data
mount -t proc /proc /tumbleweed/proc
mount --rbind /dev /tumbleweed/dev
mount --make-rslave /tumbleweed/dev
mount --rbind /sys /tumbleweed/sys
mount --make-rslave /tumbleweed/sys
cp -L /etc/resolv.conf /tumbleweed/etc
chroot /tumbleweed /bin/zsh # My preferred shell
(these commands collectively I will refer to as (1)) then in the chroot I re-installed GRUB with:
grub2-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sda
(a valid grub.cfg was already at /boot/grub). Then I typed:
efibootmgr
to confirm that this had added an entry called “opensuse” to the Boot Manager and it had. Then I rebooted again, pressed F9 and I saw the above Boot Manager screen (i.e. Figure 2) again, with only those two options! The “opensuse” option that efibootmgr had shown was added by the grub2-install command wasn’t there! Then I rebooted the Zorin session, ran (1) and then in the chroot I ran:
efibootmgr --create --disk /dev/sda --part 1 --label 'openSUSE Tumbleweed' --loader /EFI/opensuse/grubx64.efi
(which is a command I learnt at an earlier thread of mine — https://forums.opensuse.org/showthread.php/532906-How-to-rename-UEFI-bootloader-entries?p=2879133) and rebooted. Yet again I was welcomed by two entry Boot Manager (the EFI file one and the notebook hard drive one), exactly like the one shown in Figure 2. This really ticked me off. I should warn you that I installed FreeBSD to /dev/sdb3, with /dev/sdb2 being its ESP partition. Having two ESPs didn’t create a problem before, however, so I don’t think this is related. I tried booting normally (without pressing F9) but I was welcomed by:
https://imgur.com/CaqbvoK.png
(Figure 3). This seems to be the “Notebook Hard Drive” option shown in Figure 2, as when I select it I get this. As for selecting the “Boot From EFI File” option in Figure 2 I get:
https://imgur.com/B25L7G1.png
If I select this, select “efi” in the next menu (which is the only option given there), then I see three options: “boot”, “…” and “.” (I’m going to call this menu, menu 3). If I select “boot” and then “BOOTx64.efi” in the next menu it boots my FreeBSD 11.2 install. As it seems the /dev/sdb2 ESP was recognized by the “Boot From EFI File” option I decided to install my Arch bootloader there too (chrooted into it from an Arch live session, as I had a USB with it too, mounted up /dev/sdb2 to /boot/efi, ran grub-install and that was it), and luckily it appeared in the menu 3 and I was able to start Arch’s bootloader via it and boot openSUSE Tumbleweed from it. This workaround is good to have, but I would like my PC to automatically boot openSUSE on start up so I tried re-installing grub with grub2-install, hoping installing it from an actual (as opposed to live) system would allow grub2-install to create a GRUB install listed in the Boot Menu. I rebooted and found the menu shown in figure 2 again! Then I booted Tumbleweed again (using the Boot From EFI File method) and ran:
efibootmgr --create --disk /dev/sda --part 1 --label 'openSUSE Tumbleweed' --loader \EFI\opensuse\grubx64.efi
. Note how I replaced forward slashes with backslashes just in case since it’s a FAT32 partition (which was originally, to my understanding, a Windows file system) it required backslashes instead. I rebooted and yet again I was greeted by the Boot Menu shown in figure 2. I have tried reformatting /dev/sda1 with:
mkfs.fat -F32 /dev/sda1
then, in GParted, I set the appropriate flags for /dev/sda1 (boot, esp). Then I installed grub to it with:
grub2-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sda
and just for good measure I created an additional menu item for Tumbleweed with:
efibootmgr --create --disk /dev/sda --part 1 --label 'openSUSE Tumbleweed' --loader \EFI\opensuse\grubx64.efi
(btw I have checked /boot/efi/EFI/opensuse/grubx64.efi exists and it does). Rebooted and still I saw Figure 2 again! So folks please tell you have a fix for this… I experience this issue before when installing Rawhide and I found replacing Rawhide with Fedora 28 (F28), by booting a live session for F28 and running the installer, fixed it. I don’t want to lose my Rawhide install so please tell me there’s another way to fix this.
Thanks for your time,
Brenton