Usually when we install Windows after installing GNU/Linux, we usually lose the Grub. Which is the best way to recover grub when we lost grub or what are the possible different ways.


2 Answers 2


You need to boot system using LiveCD of ubuntu and run below command to install grub :

sudo grub-install /dev/XXX

above command will install grub and it also Keep windows bootloader NTLDR into grub , then you can choose any one OS while boot.

/dev/XXX this is your HDD where ubuntu installed (eg: grub-install /dev/sdb).

Please refer below link for more information :



Late but the problem is as recent as it can be. I managed to avoid creating an up-to-date Live CD/USB stick to issue the recommended range of commands. From within Windows 10 Command Prompt (not PowerShell!) with admin rights, I used:

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

for EFI Secure Boot. You can normally use

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

More details and screenshots here and here.

  • At least for Windows 7 didn't work. Mar 21, 2021 at 23:26
  • Hi, I see, W7 was the one back then, so which errors did you get if any? Unfortunately, the guides I used assume that W10 is installed. I added that detail.
    – mfg
    Mar 22, 2021 at 0:24
  • No errors. But on restart nothing changed. Mar 22, 2021 at 1:00
  • Hmm, maybe settings like bootmgr might have changed from W7 to W10. See e.g. neosmart.net/wiki/bcdedit/#BCDEdit_on_Windows_7 Maybe try bcdedit /? to find out. Moreover, are you using EFI at all? Is there a grubx64.efi file in the partition?
    – mfg
    Mar 22, 2021 at 7:43

You must log in to answer this question.

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