0

When I boot into my computer (it says "GRUB version 2.something" at the top) , Windows shows as one of the options, yet I have removed the Microsoft folder from /boot/efi/EFI.

I tried to run grub/grub-update but I don't have those binaries in my path.

Fedora Linux 38 (Workstation Edition) x86_64
6.3.8-200.fc38.x86_64
Z0OM
  • 3,149

2 Answers2

1

With the message GRUB version 2.something (!) at the top of the boot screen that shows Windows, it should be easy to remove the final vestiges of that OS.

What's happened is that when grub was last run (or installed) it found Windows as an alternate bootable OS, and so included it in the list of options. You simply need to re-run its configuration/installation phase and Windows will no longer be listed.

Instructions are at What is the equivalent of 'update-grub' for RHEL, Fedora, and CentOS systems, which appears to simplify down to running one command as root,

sudo -s                                            # Or otherwise become root
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg    # Rebuild the grub menu

Unfortunately I cannot test this command, so check that /boot/efi/EFI/fedora/grub.cfg exists before running grub2-mkconfig.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287
  • Also check that /boot/efi/EFI/fedora/grub.cfg is longer than just a few lines before overwriting it with the full GRUB configuration. It seems that Fedora/RedHat is switching to similar setup as Debian and relatives, with a mini-grub.cfg on the EFI System Partition that essentially just points to the actual configuration located in the well-known location, /boot/grub/grub.cfg. – telcoM Jun 24 '23 at 19:28
  • @telcoM thanks for that. I've not seen this on Debian myself – Chris Davies Jun 24 '23 at 20:41
0

Since your system uses UEFI, you'll need to learn about the efibootmgr command. It allows you to view and manipulate UEFI NVRAM boot variables - and such a boot variable for Windows is what causes the text "Windows Boot Manager" to appear in the boot section of your BIOS menus.

With efibootmgr -v, you should see a list of boot variables and their values, similar to this:

BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0004,0002,0000,0006,0005,0001,0003,0007
Boot0000* Windows Boot Manager  HD(1,GPT,01234567-89ab-cdef-0123-456789abcdef,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.0.1.2.3.4.5.6.7.-.8.9.a.b.-.c.d.e.f.-.0.1.2.3.-.4.5.6.7.8.9.a.b.c.d.e.f.}...d................
Boot0001* UEFI:CD/DVD Drive     BBS(129,,0x0)
Boot0003* UEFI:Removable Device BBS(130,,0x0)
Boot0004* debian        HD(1,GPT,01234567-89ab-cdef-0123-456789abcdef,0x800,0x82000)/File(\EFI\debian\shimx64.efi)
[...]

To delete a boot option, first identify its four-digit BootXXXX identifier, and then run efibootmgr -b XXXX -B to delete it. So in my example, the identifier for Windows is Boot0000, so the command would be:

efibootmgr -b 0000 -B

Another possibility is that you are seeing Windows listed in the GRUB boot menu. For that, the most probable reason is simply that you haven't refreshed your GRUB configuration since deleting the /boot/efi/EFI/Microsoft directory. That should be easily fixed:

grub2-mkconfig > /boot/grub/grub.cfg
telcoM
  • 96,466