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'.

6
  • Next would be to file a bug report.
    – Rinzwind
    Jul 31, 2015 at 11:28
  • @Rinzwind I've just sent the log to [email protected] explaining my situation. Jul 31, 2015 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. askubuntu.com/questions/597213/…
    – oldfred
    Aug 9, 2015 at 17:20
  • Keep two separate ESPs for both, otherwise Windows will erase GRUB on each BOOTMGR update. Aug 16, 2015 at 18:19
  • This brief note (linuxbsdos.com/2015/07/29/…) points out that if your ESP is in the UEFI partition, upgrading shouldn't break anything. Aug 27, 2015 at 11:49

14 Answers 14

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.

22
  • 2
    @bheeshmar: that is worthy of an answer all by itself! ;-)
    – Fabby
    Aug 16, 2015 at 17:42
  • 3
    This worked for me, thanks a lot. May i know what that command actually did please?
    – Jehoshuah
    Sep 16, 2016 at 6:51
  • 3
    FYI: doesn't work in windows powershell, need to run cmd as administrator for it to work May 3, 2017 at 1: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, 2017 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 :-) May 22, 2017 at 22:34
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.

7
  • 2
    Partly worked for me.. now it boots straight into linux without showing boot menu
    – PowerAktar
    Jul 16, 2016 at 19:37
  • @PowerAktar have you tried pressing "ESC" to show the grub menu? Aug 9, 2016 at 0: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, 2016 at 3: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! Nov 22, 2016 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! Feb 22, 2019 at 0:54
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!

4
  • More of a step by step by step would be helpful
    – Veridian
    Aug 11, 2015 at 20:36
  • This solution worked for me too.. and saved my day :) PS. This step by step may help: cgsecurity.org/wiki/TestDisk_Step_By_Step Nov 6, 2015 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, 2016 at 2: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, 2016 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.

4
  • 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. askubuntu.com/questions/654386/… Windows has always "forgotten" to include the Linux partition when it rewrites partition table.
    – oldfred
    Aug 18, 2015 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, 2015 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 2, 2016 at 8:45
  • 1
    @oldfred Windows rewrites the table when doing the upgrade? That's scary. Jun 29, 2016 at 11:55
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.

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 :)

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 ...

4
  • I too suffered a wiped partition with the upgrade. Aug 2, 2015 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 ... Aug 2, 2015 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. askubuntu.com/questions/654386/… 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 9, 2015 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. Aug 18, 2015 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.
3
  • In my case, my system boots into windows after BootRepair.
    – tbear
    Nov 12, 2015 at 12:35
  • 1
    Further, all linux partitions were gone just like Francesco. You were lucky.
    – tbear
    Nov 12, 2015 at 12:42
  • @tbear so how did you recover?
    – Greg Bell
    Apr 30, 2016 at 2:28
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

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.

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.

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.

-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.

4
  • This doesn't really answer the question. Oct 28, 2015 at 23:17
  • @Zacharee1 the proposed solution by the user is "Hit escape, to get to teh Diagnose PC screen, which gives a USB boot option". It's not a good answer but it's an attempt to answer.
    – Thomas Ward
    Oct 28, 2015 at 23:17
  • @ThomasW. OK. I don't really see it though. Oct 28, 2015 at 23:18
  • @Zacharee1 see my edits - it splits it up a little, but the point is that while it's an answer it's not a real good one, and it doesn't really provide a great answer
    – Thomas Ward
    Oct 28, 2015 at 23:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .