Recover GRUB after installing Windows

Tags: #<Tag:0x00007fe323d36130>

Hi,

Installed Windows 10. Grub removed.
How do I recover GRUB after installing Windows?

Thanks,

Pujitha

You will need to boot with a Live CD/USB. Here is a link on how to fix it with a Live Ubuntu version.

https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

If you boot a live OpenMandriva system you can use the terminal way in the article to fix grub.

@pujithadimuthu This is current to the best of my ability:

In that Ubuntu doc the “Graphical way” and “Ubuntu Alternate CD” probably will not work in OM Lx. The section on “The terminal way” has elements needed but I think is not quite accurate for OM Lx.

OpenMandriva needs better documentation on this. And we will have that some day, but I won’t promise any time frame since everyone involved with OM Lx is an unpaid volunteer and we all have other work/family/life commitments.

However with this article you should be able to figure out how to do this on a Windows/OM Lx multi-boot system. I suggest using the Rescatux CD if it will boot for you as that can re-install grub2 automatically. If Rescatux does not boot you should be able to use Super Grub2Disk to boot in to your system and re-install grub2 with these commands. The first command creates the grub2 menu:

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Then this command installs grub2 to BIOS mbr or EFI Firmware:

$ sudo grub2-install /dev/xxx

where you replace the “xxx” with the name of the drive you want to, or were booting OM Lx from, like sda or if it is a nvme drive something like nvme0n1.

I do know that in normal circumstances, (meaning nothing was erased from /boot/efi partition that should not have been), then if user can use Super Grub2Disk to boot in to the system user wants to boot from the above commands do work to do that. (This has been tested.)

Also the above commands should include your Windows system in the grub2 menu.

There is a wiki article for this now here.

I have 2 HDDs

HDA has Windows 8 and Mageia 4
HDB has Windows 10 and OMV 4.1

What will happen if I type

update-grub2
grub2-install /dev/sdb

on Mageia 4?

Depends on which drive your BIOS or EFI firmware is booting from. There should be a setting in your BIOS or EFI firmware for the boot order, to set whether it looks first to /dev/sda or cd/dvd or /dev/sdb, ect.

But if it is booting from /dev/sdb that should work. You would be using the grub2 boot-loader, menu, theme, ect. from your Mageia 4 installation. If grub2-install /dev/sdb does not work the next suggestion would be grub2-install /dev/sda.

Let us know if it does or does not work and if it does not work post any error message.

I have BIOS. I tried grub2-install /dev/sda in Mageia 5 (Correction) Command not found.

I tried to add Grub Parameters But some I do not know. Mageia 5 has MCC
If I boot OMV 4 from Mageia 5 then I can execute grub2-install /dev/sda.

I can update grub menu and add entries and boot OMV 4

Well it looks like you got your problem corrected.

Mageia may not use exactly the same command. Some distros use grub-install instead of grub2-install. Any instructions I give are tested only in OpenMandriva Lx so may/may not be correct in other distros.

If you mean on OM Lx options for grub2-install use --help and man. Like this:

$ sudo grub2-install --help

$ sudo man grub2-install

Or were you meaning kernel boot parameters?

kernel boot parameters? yes. Need to add to the grub.

grub-install /dev/sda not working… So Format and install the OS

For OpenMandriva Lx. This adds changes to all graphical and “console mode” boot entries but will not change “recovery mode” entries. To add kernel boot parameters on permanent basis you add them to the file /etc/default/grub to the line that begins GRUB_CMDLINE_LINUX_DEFAULT=. That is highlighted in this screen shot:

So to that file I’ll add radeon.si_support=0 amdgpu.si_support=1 which for me forces OM Lx to use amdgpu driver for my video card (gpu) instead of radeon driver.

After adding anything to, or subtracting anything from, that file you then need to run:

$ sudo update-grub2

to update grub2 menu (/boot/grub2/grub.cfg) and reboot. Hope that is information you were looking for. For lists of kernel boot parameters you can find that with internet search.

So if you want to check if changes were/were not made you look at the file /boot/grub2/grub.cfg before and after doing the steps above. The changes will be in a section called:

### BEGIN /etc/grub.d/10_linux ###

To what we call the “linux” line.

For OpenMandriva Lx the command is:

I use this command normally several times every week in testing things. (In all versions of OM Lx too.)