Score:2

Ubuntu 20.04 fails to boot after I ran "/bcdedit set {bootmgr} path \EFI\ubuntu\grubx64.efi" in Windows

mx flag

I was having issues getting the GRUB bootloader to be the default on my system, which is a dual boot between Windows 10 and Ubuntu 20.04. It didn't appear in my UEFI/BIOS anywhere, and I read online that running

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

Would set it to default to grub within windows, meaning I could pick each time I boot my system which OS to use, rather than have it just default to Windows or Ubuntu as it had been doing. When I did this, though, I get an error message on three lines when trying to boot Ubuntu that reads:

failed to open \EFI\UBUNTU\(gibberish characters including some chinese characters) -- invalid parameter
Failed to load image \EFI\UBUNTU\(gibberish characters including some Chinese) -- invalid parameter
start_image() returned invalid parameter

Then, it just boots into Windows. GRUB is nowhere to be seen.

Furthermore, I cannot boot into Ubuntu at all if I manually chose it while booting, getting that same erorr. I tried to undo the command I ran in Windows but it didn't work. I'm worried that I'll have to format the partition with Ubuntu on it and start over, which I really do NOT want to do.

Before I ran the windows command, I could boot into Ubuntu if I pressed F11 on my boot (I'm using MSI b550 PRO WIFI), and then chose ubuntu there. However, the GRUB bootloader did not appear (and GRUB also did not appear in the boot order in the BIOS/UEFI). That's why I did all this, and now it seems I cannot run Ubuntu, presumably because I messed something up with the windows command.

More information: if I run

bcdedit \enum {bootmgr}

I get that the Windows Boot Manager has path = "EFI\UBUNTU\SHIMX64.EFI" which seems weird, since I definitely didn't type that in the first time. Could that have something to do with why Ubuntu won't boot?

Update: I found this similar problem from years ago: Cannot access Ubuntu 18.04 in dual boot, because system boots straight to Windows 10

I've tried the first solution (in which setting the directory says the file path does not exist), and the third solution, which when I run the

cp -p .... \EFI\ubuntu

it tells me that the file I am trying to mount does not exist.

Score:0
fr flag

I had the same problem, even if I didn't run any command in Windows before. Searching the internet I found some other person with the same problem (eg. here). I don't think the command you used in Windows is the problem.

I found out that my problem was probably some kind of Windows problem that was causing errors in GRUB loading. What actually worked for me was reinstalling GRUB for UEFI boot (and not for the Legacy one), following the arch wiki and changing my BIOS settings from "Legacy+UEFI" to "UEFI".

Now it all works without any problem.

I hope it helps!

jack17212 avatar
mx flag
Thanks, I appreciate it. Unfortunately I don't think this was the issue for me. Both Windows and Ubuntu were installed in UEFI mode, and my Mobo was set to UEFI as well. I haven't done it yet, but after messing around with stuff, I locked myself out of Windows for good but can get into Ubuntu. Now, I'll just be re-installing Windows and hoping that works. If not, I have no choice but to nuke everything and start over. It's really a shame that there isnt' much online to explain what exactly these error messages are, I would have loved to know irrespective of a solution.
Score:0
in flag

I got the same errors. Have you Installed any ubuntu updates? (for me it was around 200mb). I just timeshifted to the day before I updated Ubuntu. Then the updates again show up. But now I'm scared of doing it. I thinks its some kind of a bug. enter image description here

Same Questions: 1 2 3

Score:-1
ru flag

I have a Windows machine which could dual boot between Windows 10 and ubuntu 18.04. After some Windows upgrade in Feb 2022, the machine could only boot directly into Windows 10. Thanks to the answers above and collected elsewhere, here below were the steps that I fixed the dual boot failure.

Step 1: Use bcdedit to set the correct booloader path for grubx64.efi

First, let’s check current BCD (Boot Configuration Data) settings. In windows, open command prompt as administrator, and type

bcdedit

In my case, it looks like

Windows Boot Manager
—-----------------------------
identifier    {bootmgr}
path          \EFI\ubuntu\shimx64.efi
...

Since my computer disables the secure boot, I should not use shimx64.efi. Hence, I changed the path to grubx64.efi using the command recommended by many people as

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

You can type bcdedit again to double check the path was now changed to

Windows Boot Manager
—-----------------------------
identifier    {bootmgr}
path          \EFI\ubuntu\grubx64.efi
...

Step 2: Copy a grubx64.efi bootloader to EFI System Partition (ESP)

In my Windows machine, the grubx64.efi bootloader was somehow lost after a previous Windows upgrade. Here below are the steps to check whether the bootloader exists in the EFI System Partition (ESP) or not.

In windows, open command prompt as administrator, and type the following commands to mount the boot partition on the drive P:. If P: is an existing drive, you should choose another drive, e.g., Z:. After mounting the system partition, change directory to the drive to check what files are in the \EFI\ubuntu directory.

mountvol P: /S
cd /d P:
cd EFI
cd ubuntu
dir

In my case, the directory contained shimx64.efi, mmx64.efi, grub.cfg, and BOOX64.CSV. It was good that grub.cfg was still there. However, there was no grubx64.efi.

Hence, what I did was to copy a grubx64.efi file into this directory. In my case, I had a USB drive with ubuntu 18.04 (my ubuntu image version). I inserted the USB drive into the Windows machine. The new drive appeared to be in F:. Since I was already in P:\EFI\ubuntu, I copied the bootloader without specifying the destination path.

copy "F:\efi\boot\grubx64.efi"

So far, I had done two things.

  1. Used bcdedit to Set the correct booloader path for grubx64.efi.

  2. Copied a grubx64.efi bootloader file to the EFI System Partition (ESP).

I rebooted the Windows machine, and the dual boot was working again. I can now boot into either Windows or ubuntu in turn smoothly without issues.

ChanganAuto avatar
us flag
Windows feature updates tend to change the boot order to Windows first for "convenience" (it takes one or several reboots). All users should do after assuring the Windows update process is actually finished is to open UEFI settings > Boot menu and change it back to Ubuntu. That's absolutely all. This answer is unhelpful, the method *may* have some merit for some "broken" UEFI implementation that insist in booting Windows only. NOT THE CASE HERE by your own report.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.