Grub doesn't show openSuse boot option

Hi there!
After I installed several updates, and after I rebooted the system, Grub no longer shows OpenSuse boot option. (Grub only shows Windows boot option in a black screen. Grub version 2.0.4)
Now I cannot boot openSuse.
How can I get Grub to show back openSuse boot option?

Thank you, in advance.

I’m puzzled as to how that is even possible.

There should be a boot option for each installed kernel.

Is it possible that you accidentally removed all kernels?

I don’t think so.

Try exploring the boot options from grub using this method:
https://www.howtoforge.com/tutorial/repair-linux-boot-with-grub-rescue/

You basically need to start from grub command line and explore

ls (

then use “tab” twice to see what options you have and look for something like

(hd0,1)/boot/grub

If you can’t find anything, you may have accidentally deleted at least the default kernel. If that’s the case, you need a USB stick with LEAP/TW installed.

If you do find something and boot from it, Yast Bootloader should be able to fix this for you.

If that was the case… Is it posible to rapair the system with the rescue optionof the installation DVD?

Yes, but it’s a bit complicated.

If you mean by: kernels not deleted = It’s easier to just configure your grub and boot from existing ones and use the Yast Bootloader, this is the cleanest and easiest way.
You can also use the rescue media to explore the existing kernels, and mount, bind and chroot the existing / then re-compile the kernel or reconfigure grub by:

mkinitrd

or

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

in either of the case, you want to make sure that you can see the linux entries in your /boot/grub2/grub.cfg

on binding, mounting and chrooting: (https://forums.opensuse.org/showthread.php/535481-Kernel-disaster-recovery)

If you mean by: kernels deleted = You need to use a rescue media to mount, bind and chroot your existing / and download and install a kernel. This is not very trivial because you need to set up your rescue environment. Personally, I have a shared NTFS partition between linux and W10 and I downloaded kernel from W10, placed it in the shared partition and installed downloaded kernel. I’ve done exactly this in the same link above (https://forums.opensuse.org/showthread.php/535481-Kernel-disaster-recovery).

Thank you, very much!

Both opensuse and Windows, when installed on the same computer, have a tendency to delete boot options of the other OS. Usually happens after updates, 1-4 times per year.

If opensuse has deleted Windows’s boot option, then the solution is easy: boot into opensuse, and reinstall the boot loader. If this is done in Yast, don’t forget to enforce “Probe Foreign OS”.

If Windows has deleted the opensuse’s boot option, then the story is longer. Boot from a Live or rescue Linux USB flash drive or CD, and do these steps. They are described in more details elsewhere; here is an approximate sequence of steps:

  1. Identify the root partition (/, not /root) and mount. (The root partition contains /etc and /home):
mount -t ext4 /dev/sda2 /mnt
  1. If UEFI boot is used, identify and mount the the FAT partition used for booting:
mount -t vfat /dev/sda1 /mnt/bootefi
  1. Mount (bind) three filesystems:

  mount --rbind /proc /mnt/proc
  mount --rbind /sys  /mnt/sys
  mount --rbind /dev  /mnt/dev

  1. Optionally, one more mount:
 mount -t devpts pts /mnt/dev/pts
  1. Change root (chroot):
chroot /mnt
  1. Optionally, mount all filesystems:
mount -a
  1. Reinstall grub with one of these methods, or with some other command:
grub2-install --target=x86_64-efi /dev/sda

grub2-install --target=x86_64-efi --efi-directory=/bootefi /dev/sda

Start yast,  go to System -> Boot Loader

Start yast2, go to System -> Boot Loader
  1. Exit the chroot environment:
exit
  1. Unmount the filesystems in reverse order:

  umount /mnt/dev/pts
  umount /mnt/dev
  umount /mnt/sys
  umount /mnt/proc

  1. Reboot
reboot

You may want to specify what your /dev/sda1 and /dev/sda2 are. Your instructions seem sound for your specific setup but may not be applicable to the OP.

I think the OP has encountered exactly the “Boot option of an OS disappeared!” problem that I face regularly on several computers. Here is what he says:

*“After I installed several updates, and after I rebooted the system, Grub no longer shows OpenSuse boot option. (Grub only shows Windows boot option in a black screen. Grub version 2.0.4)
Now I cannot boot openSuse.”
*
It is quite frightening for an inexperienced soul (“To the hell with these irresponsible programmers and their defective OSes, but are my files gone?”).

/dev/sda1 is the partition on which the root of Linux filesystem (/) exists. The size of this partition might be from 1 to 40 GB, often close to 8 GB. The filesystem type usually is ext4, btrfs, XFS, reiserfs. It is very unlikely to be vfat, NTFS, exFAT. Cannot be swap.

/dev/sda2 is the vfat- or FAT32-formatted partition on which UEFI boot partition exists. It is a small partition normally, between 0.05 and 1 GB. This partition exists only if UEFI boot is used in the computer. Most modern computers use UEFI and most old computers (before 2010) don’t.

The exact names of disks and partitions (/dev/sda, /dev/sdb, /dev/sda1, … ) can be found out by mounting all partitions in the computer one-by-one (in Live Linux), and analyzing their filesystem type, size and content. I suggest don’t use

-t auto

option for mounting. Also don’t forget to unmount after analysis.

In simple scenarios (one or two disks, Linux+Windows, no traces of previous OSes), identifying the needed partitions is easy, especially with help from Internet.

It appears to me that having Windows in multiboot with TW isn’t necessary to lose a TW boot option. I just filed 1175271 – latest kernel installation's initrd results in booting into emergency shell - dracut-initqueue timeout - starting timeout scripts where the update in addition to building a bad initrd managed to switch the firmware priorities so that the UEFI fallback had precedence over the TW entry. After zypper dup:

# efibootmgr
...
BootOrder: 0001,0000,0003,0002
Boot0000* opensusetw
Boot0001* UEFI OS
Boot0002* Hard Drive
Boot0003* CD/DVD Drive

Corrected/restored::

# efibootmgr
...
BootOrder: 0000,0001,0003,0002
Boot0000* opensusetw
Boot0001* UEFI OS
Boot0002* Hard Drive
Boot0003* CD/DVD Drive

I know this is different from a missing TW menu option in Grub, but the packaging processes involved in updating Grub and UEFI entries would seem to be related at the least. :stuck_out_tongue:

A bit off an off-topic question. Did you use the Window’s 100MB EFI to install your OpenSUSE EFI? I typically create one for Linux and one for W10 to avoid such problems and I’ve had 0 issues related to one OS crippling another after an update.

I use different partitions and sometimes different disks for Windows and Linux. EFI partition is not reused.

I have the issue on all computers, not often, though.

I am really curious how we can reproduce such effect. Do you know exactly how to reproduce these?

On 5/6 of my machines have Linux+W10 with 2 distinct EFI partitions and I’ve had them for several years now. They all have 100MB W10 default EFI partition and 300MB Linux dedicated EFI partition and I have never an into forementioned problem ever.

I’ve only ran into such problems when I was just starting to use linux and only when I either used MBR for linux+W10 boot, or when I used 100MB W10 default EFI for both W10 and linux to share.

In any case, I hope the OP fixed his computer.

You cannot intentionally reproduce. You can wait until it happens. For that:

Install Windows 10.

Install opensuse, either on the same disk by squeezing the Windows’s main partition, or on another disk.

Use UEFI boot.

Go on with opensuse’s installer’s default settings in terms of booting.

After boot, verify that “Probe Foreign OS” is selected. If you want, you can reinstall the boot loader. Verify that both OSes boot normally.

Wait until Windows has a major (feature) update. There is 30% chance that the update will overwrite the boot sector, leaving no Linux boot options. Or it will change the boot options in some other way. Or the update will fail, because Windows will be confused by unusually-sounding boot sector.

Or wait until there is a big update of opensuse. Usually, after a normal installation, there are three boot options offered in Grub. After this unhappy update, two are left: opensuse 15.2 and opensuse 15.2 with safe settings. Booting into Windows is gone.

and

Wait until Windows has a major (feature) update. There is 30% chance that the update will overwrite the boot sector, leaving no Linux boot options. Or it will change the boot options in some other way. Or the update will fail, because Windows will be confused by unusually-sounding boot sector.

This does not actually make sense.

UEFI booting does not use a boot sector.

Perhaps your UEFI Firmware (or BIOS) dropped the openSUSE boot entry. Or perhaps it dropped the Windows boot entry, and then Windows put it back and made it first in boot order. Either way, your thread title is misleading, because it wasn’t “grub” that failed to provide the boot entry.

Or wait until there is a big update of opensuse. Usually, after a normal installation, there are three boot options offered in Grub. After this unhappy update, two are left: opensuse 15.2 and opensuse 15.2 with safe settings. Booting into Windows is gone.

That sounds like a different problem. You have both 15.2 and Tumbleweed installed. A recent “grub2” update in Leap 15.2 gave its bootloader the priority. I am guessing that you installed that grub update with the desktop update applet. There’s a bug reported for that problem.

Bug 1175315

Boot into Leap 15.2. As root, run:

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

and you should get your Tumbleweed boot option back.

It depends upon what has happened. Booting with grub on an uefi system involves 3 items:

  1. the boot loader sitting on the efi system partition:
erlangen:~ # df -h /boot/efi/
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       101M  1.7M  100M   2% /boot/efi
erlangen:~ # ll /boot/efi/EFI/tumbleweed-btrfs/grubx64.efi
-rwxr-xr-x 1 root root 311296 Aug 17 10:43 /boot/efi/EFI/tumbleweed-btrfs/grubx64.efi
erlangen:~ # 
  1. the boot menu:
erlangen:~ # ll /boot/grub2/grub.cfg
-rw------- 1 root root 10549 Aug 17 10:43 /boot/grub2/grub.cfg
erlangen:~ # 
  1. the uefi boot stored on the main board’s non volatile memory:
erlangen:~ # efibootdump Boot0000
Boot0000: * tumbleweed-btrfs HD(1,GPT,2fe6b58a-379a-4f6e-899b-8be22ef6e885,0x800,0x32800)/File(\EFI\TUMBLEWEED-BTRFS\GRUBX64.EFI)
erlangen:~ # 

Recovering from a mishap requires checking each of these items and restoring them if damaged or missing. Boot into a rescue system and run grub2-install, grub2-mkconfig and efibootmgr as needed.

Examples:

mount /dev/sdb5 /mnt          # System Partition
mount -o bind /dev /mnt/dev
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
chroot /mnt
mount /dev/sdb1 /boot/efi     # EFI System Partition
**grub2-install**
**grub2-mkconfig -o /boot/grub2/grub.cfg**
exit
erlangen:~ # **efibootmgr --create --disk /dev/sda --part 1 --label test --loader /EFI/opensuse/grubx64.efi**
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0007,0000,0004,0001,0002,0003,0005,0006
Boot0000* tumbleweed-btrfs
Boot0001* leap-15.2
Boot0002* opensuse
Boot0003* ubuntu
Boot0004* tw-20200515
Boot0005* arch
Boot0006* manjaro
Boot0007* test
erlangen:~ # efibootdump Boot0007
Boot0007: * test HD(1,GPT,2c0e640c-3df5-470a-a17c-89b17eba59d8,0x4002800,0x3fff000)/File(\EFI\opensuse\grubx64.efi)
erlangen:~ #