How to Fix Arch os-prober not Detecting Windows Installation

by Jack
7 minutes
How to Fix Arch os-prober not Detecting Windows Installation

As a beginner, if you try to dual boot Arch Linux or any other Arch based distro such as Manjaro, Artix, Archlabs or Archcraft then there is a good chance you will run into a situation where Grub no longer shows "Windows" entry on boot selection menu. Also, when you reach the desktop, the os-prober command produces blank output.

This is a clear indication that you have messed up the EFI partition, but there is a way to fix this. In this Linux tutorial, you will learn how to fix Arch os-prober issue and restore Windows boot entry on the boot selection menu. To make things work, your PC/laptop needs to satisfy the following conditions.

  • You are able to boot in the newly installed Arch Linux based OS.
  • Windows EFI partition still exists.
  • The Windows installation partition is untouched and has all the files and folders (Program Files, Windows, Users, etc.).
  • Secure boot is turned off.

Let's get started. Follow all these steps in order.

Step 1: Find out the EFI Partition

In dual boot installation, usually the /dev/sda1 is the EFI partition. But it can be different in some cases. To correctly find out the EFI partition, run this command:

sudo fdisk -l

Look for the partition type EFI System or BIOS boot.

Find out EFI partition using fdisk command.

Note down the corresponding partition name. In this case, it is sda2.

Step 2: Find out UUID of EFI System Partition

This is fairly easy as there is a very simple command to do it. We need UUID in order to create GRUB configuration manually. So, use this command:

sudo blkid /dev/sda2

get UUID of Windows partition on Linux

Take note that I have substitute sda2 in the command above. If EFI/BIOS partition is some other, then you need to enter the name correctly. It can be sda1, sda3 or something like /dev/pci0000.

Step 3: Edit GRUB Configuration File to Manually add Windows Entry

Open GRUB configuration file, 40_custom in nano or any other text editor with root access. Here I will use nano and to use it, you can type or copy-paste the following.

sudo nano /etc/grub.d/40_custom

The file will now be displayed, and you just scroll down to the bottom and paste this snippet:

menuentry "Windows" --class windows --class os {
    search --fs-uuid --no-floppy --set=root UUID_Here
  chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

Edit GRUB configuration

Just replace the UUID that you generated in Step 3 with UUID_Here. Save the changes afterwards. In nano editor, use Ctrl+O to save changes and press Enter to confirm. Next, use Ctrl+X to exit the editor.

Step 4: Run Update Grub Command

Now, finalzie the changes by running the Update Grub command like this:

sudo update-grub

Step 5: Restart PC and Boot into Windows

If everything goes fine, you will now see Windows Book Manager entry on GRUB boot menu. Use it to boot into Windows without any problems!

This method is tried and tested on the following Arch Linux based distros.

  • Artix
  • Manjaro
  • Mabox Linux
  • Archcraft
  • Hyperbola
  • Black Arch
  • EndeavourOS
  • Arco Linux

Not only on Arch Linux but this method can work on other distros too, I am fairly certain.

Wrap up...

So far, we have learned that os-prober issue can be fixed without running update-grub or grub-mkconfig commands. All you need to do is create a manual Grub entry and correctly point the EFI destination for your second OS.

I have shown you how to generate UUID for any partition and update Grub menu entries. I ran into this issue once and spent a whole day trying to fix this. But I now hope that no one has to go through what I faced.