Boot into windows after updating bios/reinstall Manjaro

Hi,

Yes, this is another question about grub and uefi and boot...

Story:
I used to have win10 and Manjaro dual boot on my computer and it worked fine.
I updated my motherboard BIOS and when the update finished and reboot my computer, it directly boot into Windows. I tried several methods mentioned in the forum(restore grub wiki, fix grub with a livecd, set uefi in win10), but none of them worked. So finally I decided to downgrade BIOS and reinstall Manjaro.
But it still did not work. My computer directly boot into Windows. I kept restarting my computer in the last two days and ran out of methods to get grub page back. I also wonder if it is a motherboard issue.

Thanks in advance!

Platform:
CPU: AMD Ryzen 3700x
Motherboard: MSI x570 a pro
Win10+Manjaro (/boot/efi, /) installed on nvme
/home, /var on hdd

Secure boot is disabled. Windows fast boot is disabled. Motherboard is in UEFI mode.

Symptom:
My computer directly boot into Windows 10 and it does not show grub.

I can find Manjaro and grub on the "efi partition". I can boot into grub and Manjaro by entering BIOS and entering UEFI shell and run either "bootx64.efi" under Boot or "grubx64.efi" under Manjaro.

After boot into the system, efibootmgr shows

[yetianx@yetian-pc ~]$ efibootmgr -v
Timeout: 1 seconds
BootOrder: 0003,0000
Boot0000* Windows Boot Manager	HD(2,GPT,aaf50009-fd49-438c-84a9-159b0968c06a,0x109000,0x32000)/File(\EFI\MANJARO\GRUBX64.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................
Boot0003* Windows Boot Manager	HD(2,GPT,aaf50009-fd49-438c-84a9-159b0968c06a,0x109000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO

After "grub-install" and "update-grub" (both succeed), efibootmgr will show an entry of Manjaro

[yetianx@yetian-pc ~]$ sudo grub-install
正在为 x86_64-efi 平台进行安装。
安装完成。没有报告错误。
[yetianx@yetian-pc ~]$ sudo update-grub
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.2-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.2-x86_64.img
Found initrd fallback image: /boot/initramfs-5.2-x86_64-fallback.img
Found Windows Boot Manager on /dev/nvme0n1p2@/EFI/Microsoft/Boot/bootmgfw.efi
Found memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe:警告: 未知的设备类型 nvme0n1.
done
[yetianx@yetian-pc ~]$ efibootmgr -v
Timeout: 1 seconds
BootOrder: 0001,0003,0000
Boot0000* Windows Boot Manager	HD(2,GPT,aaf50009-fd49-438c-84a9-159b0968c06a,0x109000,0x32000)/File(\EFI\MANJARO\GRUBX64.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................
Boot0001* manjaro	HD(2,GPT,aaf50009-fd49-438c-84a9-159b0968c06a,0x109000,0x32000)/File(\EFI\manjaro\grubx64.efi)
Boot0003* Windows Boot Manager	HD(2,GPT,aaf50009-fd49-438c-84a9-159b0968c06a,0x109000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO

If I run efibootmgr to add an entry, it will

[yetianx@yetian-pc ~]$ sudo efibootmgr -c -d /dev/nvme0n1 -p 2 -L "manjaro" -l "\EFI\Manjaro\grubx64.efi"
efibootmgr: ** Warning ** : Boot0001 has same label manjaro
Timeout: 1 seconds
BootOrder: 0002,0001,0003,0000
Boot0000* Windows Boot Manager
Boot0001* manjaro
Boot0003* Windows Boot Manager
Boot0002* manjaro

No matter if I create a new entry for manjaro, when I reboot the system, it always directly boot into Windows. And if I manually boot into Manjaro, the efibootmgr shows nothing changed

[yetianx@yetian-pc ~]$ efibootmgr
Timeout: 1 seconds
BootOrder: 0003,0000
Boot0000* Windows Boot Manager
Boot0003* Windows Boot Manager

Blow are the output of multiple commands.*

Output of parted

[yetianx@yetian-pc ~]$ sudo parted -l
Model: ATA ST2000DM008-2FR1 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                  Flags
 1      1049kB  500GB   500GB   ntfs            Basic data partition  msftdata
 2      500GB   1000GB  500GB   ntfs            Basic data partition  msftdata
 3      1000GB  1009GB  8590MB  linux-swap(v1)
 4      1009GB  1062GB  53.7GB  ext4
 5      1062GB  2000GB  938GB   ext4


Model: Unknown (unknown)
Disk /dev/nvme0n1: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  556MB  555MB   ntfs         Basic data partition          hidden, diag
 2      556MB   661MB  105MB   fat32        EFI system partition          boot, esp
 3      661MB   677MB  16.8MB               Microsoft reserved partition  msftres
 4      677MB   333GB  333GB   ntfs         Basic data partition          msftdata
 5      333GB   500GB  167GB   ext4

Output of blkid

[yetianx@yetian-pc ~]$ sudo blkid
/dev/nvme0n1p1: LABEL="M-fM-^AM-\"M-eM-$M-^M" UUID="22643D09643CE0E9" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="f0205fde-54bf-4b03-879a-8396645192d5"
/dev/nvme0n1p2: UUID="DA3E-0FDF" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="aaf50009-fd49-438c-84a9-159b0968c06a"
/dev/nvme0n1p3: PARTLABEL="Microsoft reserved partition" PARTUUID="064a65d8-5300-4e2c-97b7-dffc55c4d9cc"
/dev/nvme0n1p4: UUID="961C50C21C509ED5" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="45f8653f-5763-4fc3-b407-9bf1cd2c4b39"
/dev/nvme0n1p5: UUID="ada9e6e2-df89-4a3b-9653-06236f0a91e1" TYPE="ext4" PARTUUID="712d26fa-a69f-49d7-88ec-24910df895d5"
/dev/sda1: LABEL="NormalProgram" UUID="8624331D24331023" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="9ce51ae6-89b6-4079-9d9f-16dea9f1d2b2"
/dev/sda2: LABEL="Data" UUID="9C544C00544BDC20" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="c591a4de-bc2a-4986-8ea1-9d0a9693d6bc"
/dev/sda3: UUID="50fe772a-7900-427a-bc52-a10ff686aa95" TYPE="swap" PARTUUID="f9dd1add-0fc6-457a-871b-816c700c6df4"
/dev/sda4: UUID="b666b115-6c8f-4f42-b957-72cccf505e83" TYPE="ext4" PARTUUID="14ff3512-6c11-4c7d-b08b-d3d59e92c565"
/dev/sda5: UUID="982122f5-247c-4d4d-8858-cf9bb4140e4b" TYPE="ext4" PARTUUID="f708789b-675f-4da1-a29e-5818f878d6c2"

efibootmgr

[yetianx@yetian-pc ~]$ efibootmgr -v
Timeout: 1 seconds
BootOrder: 0003,0000
Boot0000* Windows Boot Manager	HD(2,GPT,aaf50009-fd49-438c-84a9-159b0968c06a,0x109000,0x32000)/File(\EFI\MANJARO\GRUBX64.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................
Boot0003* Windows Boot Manager	HD(2,GPT,aaf50009-fd49-438c-84a9-159b0968c06a,0x109000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO

findmnt

[yetianx@yetian-pc ~]$ findmnt -s
TARGET    SOURCE                                    FSTYPE OPTIONS
/boot/efi UUID=DA3E-0FDF                            vfat   umask=0077
/         UUID=ada9e6e2-df89-4a3b-9653-06236f0a91e1 ext4   defaults,noatime
swap      UUID=50fe772a-7900-427a-bc52-a10ff686aa95 swap   defaults,noatime
/var      UUID=b666b115-6c8f-4f42-b957-72cccf505e83 ext4   defaults,noatime
/home     UUID=982122f5-247c-4d4d-8858-cf9bb4140e4b ext4   defaults,noatime

lsblk

[yetianx@yetian-pc ~]$ lsblk -f  
NAME        FSTYPE LABEL                    UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                                             
|-sda1      ntfs   NormalProgram            8624331D24331023                                    
|-sda2      ntfs   Data                     9C544C00544BDC20                                    
|-sda3      swap                            50fe772a-7900-427a-bc52-a10ff686aa95                [SWAP]
|-sda4      ext4                            b666b115-6c8f-4f42-b957-72cccf505e83     46G     1% /var
`-sda5      ext4                            982122f5-247c-4d4d-8858-cf9bb4140e4b  814.9G     0% /home
nvme0n1                                                                                         
|-nvme0n1p1 ntfs   \xe6\x81\xa2\xe5\xa4\x8d 22643D09643CE0E9                                    
|-nvme0n1p2 vfat                            DA3E-0FDF                              63.1M    34% /boot/efi
|-nvme0n1p3                                                                                     
|-nvme0n1p4 ntfs                            961C50C21C509ED5                                    
`-nvme0n1p5 ext4                            ada9e6e2-df89-4a3b-9653-06236f0a91e1  137.9G     4% /

Your problem happened after you updated your bios.
You did everything that needed to be done. And correctly too.

I suspect that your firmware is not BBS compliant and will need to go deep into the bios and set up BBS Priorities. Take a look at this screen shot here for this msi click bios.
He has to go to Settings > Boot > UEFI Hard Disk Drive BBS Priorities to set up manjaro grubx64.efi

TL;DR: I reversed the boot order of two "windows boot manager" and one boot into Grub and Manjaro.

Windows BCD document gave me a hint and I finally can boot into grub.

The solution works for me is set uefi in win10.

Windows creates two entries, "Windows boot manager" and "Windows boot loader" for UEFI. UEFI first boot the "Boot manager" and the "Boot Manager" will boot "Boot loader". The solution is to overwrite the path of Windows boot manager to Manjaro efi and so boot windows boot manager will trigger Manjaro efi and thus enter grub.

In my case, I believe upgrading/downgrading BIOS messed up the boot order in the partition. The BIOS directly boot "Windows boot loader" and skip the "manager". After I reversed the order, everything works fine.

Here efibootmgr output is misleading and helpful, IMO. It shows two entries with same name "windows boot manager". This is misleading because the two entries are actually one "boot manager" and "one loader". It is also helpful because the "-v" option shows the actual efi path, which gave me a hint along with Windows bcdedit /enum output.

However, this means that I t cannot have a standalone grub/Manjaro entry without touching Windows entry and the Manjaro entry can be detected by my motherboard BIOS.

Thanks, gohlip!

Exactly as what you said. I reversed the UEFI Hard DiskDrive BBS Priorities and it works.

1 Like

Welcome. Good to hear. Take care.

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

Forum kindly sponsored by