OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
boot-kernel medium very-common DISPUTE

Make Windows appear in the GRUB menu again (os-prober disabled by default)

archendeavouroscachyosmanjarogrubdual-bootwindowsuefidesktoplaptop
AUDITED Audited against its sources and confirmed accurate.
RISK

Leaving the Windows ESP permanently mounted in /etc/fstab at a writable location invites accidental damage to Windows boot files. Mount it only when needed, or mount read-only.

Symptom

Dual-boot machine: after installing Arch/EndeavourOS, or after running grub-mkconfig, the GRUB menu shows only Linux. Windows is gone. grub-mkconfig prints:


Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.

Cause

Since GRUB 2.06, os-prober is disabled by default for security reasons, so grub-mkconfig no longer scans other partitions for bootable OSes. Additionally, os-prober cannot see a Windows install whose ESP is not mounted, and cannot read an NTFS partition without an NTFS driver.

Fix

Install the prerequisites, enable the prober, regenerate:


sudo pacman -S os-prober ntfs-3g

Edit /etc/default/grub and set (uncomment or add the line):


GRUB_DISABLE_OS_PROBER=false

Make sure the Windows ESP is mounted so os-prober can find bootmgfw.efi, then regenerate:


sudo mkdir -p /mnt/win-esp
sudo mount /dev/nvme0n1p1 /mnt/win-esp     # the Windows ESP
sudo os-prober                              # should print .../bootmgfw.efi:Windows Boot Manager:...
sudo grub-mkconfig -o /boot/grub/grub.cfg

Also turn off Windows Fast Startup, which leaves NTFS dirty and hides the install from os-prober. In an Administrator Command Prompt on Windows:


powercfg /h off

If os-prober still finds nothing, add the entry by hand in /etc/grub.d/40_custom:


menuentry "Windows Boot Manager" {
    insmod part_gpt
    insmod fat
    insmod chain
    search --no-floppy --fs-uuid --set=root XXXX-XXXX
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Replace XXXX-XXXX with the ESP's FAT UUID from sudo blkid /dev/nvme0n1p1, then re-run grub-mkconfig -o /boot/grub/grub.cfg.

Verify

sudo os-prober prints a Windows line, grep -c Windows /boot/grub/grub.cfg is non-zero, and the GRUB menu offers Windows Boot Manager.

Sources

grub-windows-entry-missing-os-prober