I want to rebuild my grub2 boot menu

After many linux installations my BIOS boot menu is a mess. I have 3 linux installations and Windows on my computer and with the vagaries of time. They seem to (1) Not be able to boot every distribution , and I would like to have opensuse to be the default system.

  1. Is there a way to force grub2 to make a new entry with all systems visible?

  2. Is there a way to ensure that opeSUSE is the deault system? (Or any other distribution).

  3. Is there a way to clean out old grub2 entries that don’t boot anything?

On one of my PCs just night before last I switched the 9 year old BIOS from UEFI-only to UEFI+legacy, because I have some installations on an old MBR RAID1 HDD pair, and others on a GPT/UEFI SSD. When I got done with that need, I went into BIOS to switch back, and found the whole BIOS section regarding booting was mysteriously hidden. I restarted many times before discovering how to unhide, and when I got UEFI-only back, its priorities list was a total mess. After several more boot tries where nothing sensible would be available to select, the TW entry I needed finally showed up, and TW booted. I rebooted a few times to make sure it would stick, then I ran efiboomgr. That produced a 14 entry mess. I used efibootmgr to delete every entry except for TW’s. Now when I go into BIOS setup it makes sense. Since I don’t have Windows, I can and do use TW for booting all UEFI installations on the PC, via /boot/grub2/custom.cfg.

Check efibootmgr and BIOS, then use efibootmgr to get rid of duplicates and nonsense, and set the boot order to your liking (with TW first). If you’re not sure what constitutes nonsense, post here input/output from efibootmgr -v for us to assess.

I was able to use efibootmgr to remove unwanted menu entries. It was unnerving, though to see many entries pop in again inside the BIOS display after they were gone with efibootmgr. They are now back inside efibootmgr.

Is there any way to permanently delete these entries?

I had this accidentally happen today while flashing a new BIOS firmware.
Missed some countdown that said the boot menu was going to be reset and I lost all my boot entries, only the physical drives, USB, etc. were shown. Had to boot from the disk and get Yast bootloader to add in the opensuse entry.

Mine is a very basic BIOS too, so there must be a way for it to both reset and re-add boot menu entries.

Also, make sure “Update NVRAM” is checked in yast bootloader. May not have persisted the changes made by efibootmgr otherwise!

This incarnation of efibootmgr doesn’t seem to work as expected.

I did an “efibootmgr -o 4 5” and these entries were the first in the list but all of the others were still there.

I did an “efibootmgr -O -o 4 5” and 4 was showing as the only entry in the list. 5 would not appear. But when I rebooted, all of the entries were in the boot order but 4 was the first.

That’s not a problem with “efibootmgr”. Rather, it is your BIOS is putting those entries back on reboot.

That happens on one of my computers.

Before deleting entries via efibootmgr, make sure that you delete old boot directories under /boot/efi/EFI/ or they will reappear as you experienced. If you don’t delete the old directories from prior installations, they will reappear again and again as these directory get scanned for boot entries…

I knew I was forgetting something in my response. :stuck_out_tongue:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.