112

I've just upgraded to Windows 10 from Windows 8.1 on my partitioned laptop that has Ubuntu 14.04 installed. Grub no longer appeared on boot so I ran boot-repair from an Ubuntu liveUSB. This didn't seem to have any effect. I've checked and secure boot is still disabled.
Log from boot-repair: http://paste.ubuntu.com/11972534/
So what's next?

Update: I've attempted to use chroot to update grub from my Ubuntu partition. update-grub runs successfully finding both linux and windows boot manager but the process still doesn't have any effect. grub-install complains that it cannot find EFI directory (but I have mounted everything correctly).

Update2: Just discovered that running efibootmgr after chroot into ubuntu shows ubuntu as not being in the boot order at all. I manually changed the order and rebooted to discover that the bootorder was reset. I run in windows: bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi But this has no effect either even after reporting 'Operation Successful'.

  • Next would be to file a bug report. – Rinzwind Jul 31 '15 at 11:28
  • @Rinzwind I've just sent the log to boot.repair@gmail.com explaining my situation. – Nicholas Verstegen Jul 31 '15 at 11:54
  • If you have updated grub's files in ESP have you gone into ACERs UEFI and enabled trust on those files. You need system password set to do that. http://askubuntu.com/questions/597213/bootable-device-not-found-after-clean-install-of-ubuntu-14-04-uefi – oldfred Aug 09 '15 at 17:20
  • Keep two separate ESPs for both, otherwise Windows will erase GRUB on each BOOTMGR update. – Erkin Alp Güney Aug 16 '15 at 18:19
  • This brief note (http://linuxbsdos.com/2015/07/29/will-an-upgrade-to-windows-10-on-a-dual-boot-system-mess-grub-up/) points out that if your ESP is in the UEFI partition, upgrading shouldn't break anything. – Carles Araguz Aug 27 '15 at 11:49
  • After trying the accepted answer without success, I’ve realised I could just change the boot prioritie order in the BIOS, and when pointing it to the right partition (ubuntu), grub menu showed up in the boot :) – Raf Mar 09 '19 at 23:14

14 Answers14

160

I just had to run this in Windows as an administrator:

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

Or, if you are using PowerShell:

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

GRUB appears fine on boot and I can boot into Ubuntu and Windows 10 fine.


As pointed out in the comments (by David Faure), the final argument to this command depends on your particular system configuration. You can use this command to determine the correct path for your system:

bcdedit /enum firmware

This will list all the installed boot managers and associated EFI paths, and grub should be somewhere in the list.

Note: This works without live USB's, but you might need to boot into BIOS and turn off secure boot. This can stop the above from working.

  • 2
    @bheeshmar: that is worthy of an answer all by itself! ;-) – Fabby Aug 16 '15 at 17:42
  • This did not work for me, don't know why. Fresh Windows 10 installed upon Ubuntu 14.04, both x64 (I think). Guess I'll have to take the long route then. – Krøllebølle Jun 29 '16 at 15:48
  • 3
    This worked for me, thanks a lot. May i know what that command actually did please? – Jehoshuah Sep 16 '16 at 06:51
  • 1
    Didn't work for me, and now I think Windows boots a bit slower. How can I revert this action? – Santiago Gil Sep 25 '16 at 22:06
  • 3
    FYI: doesn't work in windows powershell, need to run cmd as administrator for it to work – William Saunders May 03 '17 at 01:26
  • 2
    @Jehoshuah It sets Grub as the system boot manager, instead of the Windows boot manager, which means that when the system starts, it runs Grub. BCD stands for "Boot Configuration Data". – wjandrea May 22 '17 at 21:13
  • 11
    Note: to find the path for the last argument to that command, you can use bcdedit /enum firmware. This helps if you're using another linux distribution and your search engine landed you here :-) – David Faure May 22 '17 at 22:34
  • 1
    Lifesaver!! Worked like a charm even on Windows 10 + Ubuntu 17.10 dual boot – Ganesh Krishnan Sep 20 '17 at 00:13
  • 1
    bcedit not recognized as an internal or external command... what I am doing wrong? – HiFile.app - best file manager Nov 27 '17 at 13:20
  • 1
    @V.K. Judging by your question - you're typing in "bcedit" instead of "bcdedit". ;) – userfuser Dec 08 '17 at 11:05
  • 1
    On a Dell XPS 13 (so UEFI&NVMe) that stopped dual booting after a Windows/Dell update, this stopped even Windows from booting. I ended up having to boot into Linux with a USB key (with fast boot off) and then using @Nir's advice to reinstall grub (although I think this advice was needed as well in my case even if it made things worse temporatily). – Gordon Williams Dec 12 '17 at 11:35
  • lifesaver! it works!As @William Saunders said, run cmd as administrator in order to work, not in powershell – e7lT2P Feb 19 '18 at 13:57
  • \EFI\fedora\grubx64.efi worked for Fedora 28 as well! – Christopher Markieta Jun 23 '18 at 06:06
  • It didn't work for me without the quotes. If you have Debina, you should replace ubuntu with debian in the said path. – Matt Aug 04 '19 at 18:51
  • 1
    If you don't remember the path for your .efi file, use diskpart for mounting your EFI volume (https://www.howtogeek.com/197296/how-to-use-the-diskpart-utility-to-assign-and-remove-drive-letters/) and then you can list your files via command prompt. – Andre Soares Aug 13 '19 at 23:38
  • how to find efi path for your os using 1.diskpart 2.list volume 3.select volume 2 (number should be as par FAT32 volume) 4.assign letter=p: and then on admin cmd 5.p: 6. cd EFI see your os name directory here – Raghavendra Dec 17 '19 at 15:24
  • 1
    efi file exist for my linux of grub but this did not worked for me – Raghavendra Dec 17 '19 at 15:48
  • It updated the path, but issue wasnt fixed. "path \EFI\ubuntu\shimx64.efi description Windows Boot Manager" – Mayank Sep 07 '20 at 17:42
  • 1
    Woah, worked for me just perfect! I only had shimx64.efi, and after reading this https://askubuntu.com/questions/342365/what-is-the-difference-between-grubx64-and-shimx64 I dcided to use it and it worked just perfect. – Ilia Andrienko Nov 20 '20 at 16:38
  • 1
    One fine morning I found my grub loader is gone. This was a life saver suggestion, thanks a bunch!! – N. F. Aug 23 '21 at 18:16
  • These steps were not enough for me. They did change the boot manager but it would still not show up. I had to enable it using bcdedit /set {bootmgr} displaybootmenu on. I came across this on http://www.mistyprojects.co.uk/documents/BCDEdit/files/examples4.htm. – Firewave Jan 12 '22 at 09:55
  • It broke again and the commands again where not enough. I had to make sure the {bootmgr} was the first entry with bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst and remove the Windows Boot Manager entry from the displayorder for {fwbootmgr} (as seen in bcdedit /enum firmware) with bcdedit /set {fwbootmgr} displayorder <GUID> /remove. – Firewave Feb 15 '22 at 22:57
27

The only solution that worked for me is described on that link I've brought it again here just because it's easier to find this thread on google.

Essentially the steps are:

  1. Using Ubuntu Live to boot in 'Try Ubuntu' mode.
  2. Use GParted to verify the correct linux partition (e.g. /dev/sda2).
  3. Mount the linux partition:

    sudo mount /dev/sda2 /mnt  #Replace sda2 with your partition number
    
  4. Mount all other linux system folders :

    for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
    

    If you are running an UEFI system, you will also have to mount your EFI directory using the following command:

    sudo mount /dev/sda1 /mnt/boot/efi
    
  5. chroot into your install

    sudo chroot /mnt
    
  6. Now that you are logged in your installation (not the Ubuntu Live) just do

    update-grub
    grub-install /dev/sda
    update-grub
    exit
    sudo reboot
    

And that's it ! Credits go do Scott Severance on the link I've mentioned above.

muru
  • 197,895
  • 55
  • 485
  • 740
Nir
  • 413
  • 2
    Partly worked for me.. now it boots straight into linux without showing boot menu – PowerAktar Jul 16 '16 at 19:37
  • @PowerAktar have you tried pressing "ESC" to show the grub menu? – InitializeSahib Aug 09 '16 at 00:42
  • The answer helped me. Basically, I booted my PC with 'Try Ubuntu' mode and installed boot-repair to fix the grub. The Linux partition was recovered. But I LOST the windows partition after the fix. So I tried to go through from the step 4 to 6. Those steps helped me to recover the windows 10 partition. Thank you Nir – r0ng Nov 11 '16 at 03:46
  • 2
    This answer is almost the same as this one in the linked question except for the worse formatting and grammar. If your answer is essentially a copy of another question, it would be better to flag this question as a duplicate of the other once you earned 15 reputation. Don't forget to vote for the answer(s) there that you found useful! – David Foerster Nov 22 '16 at 12:31
  • That is the only thing that worked for me. I noticed (L)ubuntu would not create anything in sda1/EFI/boot/..., but manually doing it, fixed it. Thanks! – user2084865 Feb 22 '19 at 00:54
  • This is the only solution worked for me. I couldn't install boot-repair somehow. – kmchmk Apr 12 '21 at 12:37
  • First make sure you're booted in EFI mode by checking that /sys/firmware/efi exists. When bind mounting /sys for the chroot, use --rbind instead of --bind, mount --rbind /sys /media/linux/sys, or it won't be able to set EFI vars. – Duke Nov 03 '22 at 19:44
4

same problem here, upgrading from windows7 to 10 in a dual boot pc... I resolved in this way:

  1. Upgrade Windows
  2. During installation process, after the first reboot, i get the grub rescue prompt, fixed this with BootRepair in a USB stick
  3. Completed the Windows installation, GRUB has gone and with a live cd of gparted i noticed that all partitions was still there but all of them were NTFS
  4. Used TestDisk from windows recovered my Linux partition
  5. BootRepair again and everything seems ok (i've Windows voice in GRUB menu duplicated.. i don't know why, but everything seems ok to me now!)

I hope it can be useful to someone!

  • More of a step by step by step would be helpful – Veridian Aug 11 '15 at 20:36
  • This solution worked for me too.. and saved my day :)

    PS. This step by step may help: http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

    – The Good Giant Nov 06 '15 at 17:58
  • 1
    How did TestDisk recover your Linux partitions? Did you just use it to change the partition type? – Greg Bell Apr 30 '16 at 02:27
  • Are you saying the Windows setup converts ext4 partitions to NFTS? What happened to things like file permissions and symlinks, which cannot be expressed 100% the same on NTFS? I would expect a partial loss of file information. – bluenote10 Jul 25 '16 at 17:49
4

My wife's machine is older (non-UEFI) and had Ubuntu installed on a logical extended partition. Upgrading to Windows 10 first killed grub so reboots resulted in the "grub rescue" prompt, which I restored with BootRepair from LiveUSB, but my Linux partition was missing! I restored this with parted rescue from LiveUSB, which found and recovered the partition. From there, I mounted the partition from LiveUSB and did a grub-install and was able to boot back into the recovered Ubuntu and Win10. Hope this helps others.

bheeshmar
  • 141
  • 4
    NOTE: All users with Windows 7 in BIOS boot on MBR(msdos) partitioned drives and Ubuntu in a logical partition will likely have this issue. Best to separately backup partition table first. Then if you have not changed partition table you can restore it directly. http://askubuntu.com/questions/654386/windows-10-upgrade-lead-into-grub-rescue/655080#655080 Windows has always "forgotten" to include the Linux partition when it rewrites partition table. – oldfred Aug 18 '15 at 15:02
  • I wish I had read this before pressing the Update to Windows 10 button on my wife's machine! :) – bheeshmar Aug 19 '15 at 17:46
  • 2
    Can you please provide a link to "BootRepair" and "parted rescue" and/or "LiveUSB"? There are lots of these things around and people might be interested in using the exact ones you did (I couldn't find them definitively on Google). – Greg Bell Feb 02 '16 at 08:45
  • 1
    @oldfred Windows rewrites the table when doing the upgrade? That's scary. – You'reAGitForNotUsingGit Jun 29 '16 at 11:55
2

We have a number of answers here providing steps on how they fixed the issue (Loss of Grub menu due to latest Win10 update). Various answers proves the solution isn't unique as the machine configs ain't unique.

For my system (Acer E5-575G-57D4), following is the fix:

Short answer:

1) In Windows, as mentioned by Nicholas in his answer, enter the following command as administrator in Windows command prompt.

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

2) Run boot-repair utility with Live Ubuntu CD/USB.

Long answer:

1) Log in to Windows.

2) Create a bootable USB stick (with your Ubuntu version) and plug it in.

3) Enter this command as administrator in command prompt:

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

Restart.

4) While it boots press F12 to see the boot menu. Select "Linux". Note: For this, "F12 boot menu" must be enabled in the BIOS settings (Press F2 while booting).

5) In the menu, select "Try ubuntu without installing", for Live Ubuntu session.

6) Connect to your WiFi. Download and run boot-repair using the following commands:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

Just follow the prompts, till you get the message that the grub is fixed. It worked for me.

Thanks :)

umash07
  • 101
2

Have you checked the order of your boot sequence? If the Microsoft boot loader is at number 2, move it to the bottom and reboot.

You can check it from within Ubuntu by running sudo efibootmgr -v in terminal.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
Adam Elvin
  • 21
  • 2
1

In my case, there is no path likes \EFI\ubuntu\grubx64.efi when running bcdedit /enum firmware. It is \EFI\ubuntu\shimx64.efi. Run the following command in Administrator mode of cmd:

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

It worked for me. Dual boot Windows 10 (1909) and Ubuntu 16.04.

le hien
  • 85
1

I am not sure that is related but I also ran into a bit of an issue trying to upgrade to windows 10 from a windows 8.1/debian dual boot.

Basically, at some point in the upgrade, I ended up with grub going into rescue mode because my debian partition had been wiped in the process and hence the boot files with it (I generally have a separate boot partition but not this time ...). From a look at this link: Windows 10 upgrade led to grub rescue

I think the problem is that windows did not write the partition table correctly during the upgrade process.

Anyhow, I fixed the problem by booting on a Win8.1 install external hdd and followed those instructions: https://neosmart.net/wiki/fix-mbr/ (scroll down to win8/8.1). That wiped grub and reinstalled mSoft's boot loader. I then managed to finish the upgrade and reinstalled debian all together since at the time I had not realised it was simply a problem with the partition table not being written correctly. Yet a better solution would be to try and recover your partition table (using testdisk?) and then reinstall/update grub.

Hope that helps.

PS: Thank you microsoft for not giving a damn about people who have a dual boot configuration ...

  • I too suffered a wiped partition with the upgrade. – Lewis Goddard Aug 02 '15 at 11:10
  • What I do not understand is how come only my root linux partition got wiped when I had 2 other logical partitions for /opt and linux-swap that were left untouched. Surely if windows really had trouble writing logical partitions in the table those should have suffered too ... – Jérémy Riviere Aug 02 '15 at 16:55
  • 1
    Have not seen issues with UEFI/gpt systems not writing partition table correctly. But any Windows 7 or 8 with BIOS/MBR and Linux in logical partitions seems to have the issue. http://askubuntu.com/questions/654386/windows-10-upgrade-lead-into-grub-rescue/655080#655080 All others with issue of missing partition only had one LInux partition as logical. But now it does seem very strange that Windows only "forgets" to write / (root) partition. And have seen it for years even with Windows 7 reinstalls. – oldfred Aug 09 '15 at 17:22
  • 1
    @oldfred It happens if the logical partitions are not numbered in order, i.e. sda6 is before sda5 inside the extended partition, and not just if they are Linux partitions (deleted Linux swap and NTFS in my case). The Windows 10 upgrade sometimes creates a new partition for a recovery environment if it doesn't fit in its boot partition. – Martin Thornton Aug 18 '15 at 11:14
1

I used the rescuetux/supergrubdisk. Booted it from DriveDroid on my android tablet. Then used auto detect rescuetux. Went into the WINDOWS button, hit the betaWindowsMBR repair button. And selected /dev/sda2 ok ok ok. Then it said successful. Now i just booted back into windows uefi menu.

1

My fix was close to @Francesco but a bit different.

  1. Upgrade Windows from 7 - 10.
  2. During installation process, after the first reboot, i get the grub rescue prompt, fixed this with BootRepair in a USB stick.
  3. Grub now appears, but is only showing Ubuntu partition, not Windows.
  4. Log into Ubuntu, go to terminal and type update-grub
  5. Now Windows shows back up in grub menu, continue with Windows 10 upgrade.
1

If you have a Win10 installation media you may use this to install a new fresh MBR. Just boot intil you see "Install now" (or similar) but do not click on it. There is a small link saying "repair tools" (or something). From this you may enter command prompt.

cd c:\windows\system32
bootrec /fixmbr

maybe even

bootrec /fixboot

This should fix the issue. But, Your Linux is longe gone due to Microsofts ignorance to peoples own choices. They have just decided that it is okay for them to delete whatever is available on your HDD and which they do not like. Therefor we may legally decide that MS is a bunch of dorks...

Win10 installation media creator tool is freely available from https://www.microsoft.com/en-us/software-download/windows10

wjandrea
  • 14,236
  • 4
  • 48
  • 98
19Vidar75
  • 11
  • 1
0

8/8/15 I upgraded from Windows 7 to Windows 10, and after Windows10 installed I made Firefox my default browser and shut down my PC, waited 15 seconds and powered up the PC and didn't even expect that it would give me an option to still choose Ubuntu within 5 seconds.I clicked Ubuntu and it seemed to hang in limbo with a grey screen for what seemed an eternity , but I didn't do anything except tapped the enter button on the keyboard to attempt get something to happen and waited , then finally the familiar black screen to choose Ubuntu or advanced options appeared. It booted up in Ubuntu fine. After I shut off and powered up in windows 10, the time and date in Windows showed 5 hours fast, just like windows 7 did after using Ubuntu, LOL. Next time I chose Ubuntu to boot the boot up wait was a lot shorter.

James
  • 1
0

For me the process was quite complicated. I use boot repair form the usb stick, and after I remove the usb stick and restart the computer only ubuntu login option came. I log into Ubuntu which was installed in my computer hard disk and then use boot repair again. After that when I restart my computer now I have the options to login into both Unbunt and winsows 10 and it's working just fine.

raz
  • 1,852
-2

After upgrading to Windows 10 on Acer Aspire-AXC-605, I could not boot into ubuntu and F2 key would not bring up bios screen so could not boot from USB ubuntu live.

I had to use Esc key while booting this brought up a "Diagnose PC" screen and I could boot USB from there.

Thomas Ward
  • 74,764
Geo
  • 1