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.
Asked
Active
Viewed 1.3k times
7
-
Related: How can I prevent Windows from overwriting GRUB when using a dual-boot machine – Gilles 'SO- stop being evil' Dec 26 '13 at 20:54
2 Answers
3
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 :
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

Rahul Patil
- 24,711
1
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

mfg
- 111
-
-
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 '21 at 00:24
-
-
Hmm, maybe settings like
bootmgr
might have changed from W7 to W10. See e.g. https://neosmart.net/wiki/bcdedit/#BCDEdit_on_Windows_7 Maybe trybcdedit /?
to find out. Moreover, are you using EFI at all? Is there agrubx64.efi
file in the partition? – mfg Mar 22 '21 at 07:43