SOLVED - Repairing GRUB.

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Qwazert
Level 1
Level 1
Posts: 43
Joined: Tue Dec 03, 2013 2:52 am

SOLVED - Repairing GRUB.

Post by Qwazert »

It's easy enough to repair the bootsector on a WINDOWS machine with:
bootrec /fixmbr
bootrec /fixboot

But how do you re-instate GRUB on a dual-boot system? How do I get back into LM when my PC won't boot at all?
Last edited by Qwazert on Tue Jan 07, 2020 7:29 pm, edited 1 time in total.

deepakdeshp
Level 17
Level 17
Posts: 7772
Joined: Sun Aug 09, 2015 10:00 am

Re: Repairing GRUB.

Post by deepakdeshp »

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

I am using Mint 20 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

Qwazert
Level 1
Level 1
Posts: 43
Joined: Tue Dec 03, 2013 2:52 am

Re: Repairing GRUB.

Post by Qwazert »

Anything "simpler"?
I predict a catastrophic failure if I tried that.

Surely there has to be something as simple as bootrec...

decrepit
Level 4
Level 4
Posts: 366
Joined: Mon Dec 03, 2018 4:07 am
Location: Mandurah Western Australia

Re: Repairing GRUB.

Post by decrepit »

A bit more info may help.
What do you mean by won't boot? Do you get into grab at all, a terminal prompt perhaps? Or just a black screen? Is the bios boot priority correct?
Do you still have the install medium?

User avatar
kukamuumuka
Level 16
Level 16
Posts: 6676
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: Repairing GRUB.

Post by kukamuumuka »

Legacy grub2 requires different method like grub-efi. Two examples:

Case Legacy grub2 : viewtopic.php?p=1322796#p1322796

An another way to install grub2 via liveDVD or USB goes like

Code: Select all

sudo mount /dev/sdXY /mnt  # where X=drive and Y=partition
sudo grub-install --boot-directory=/mnt/boot /dev/sdX  ## where X=drive
sudo umount /mnt
Case grub-efi : viewtopic.php?p=1731684#p1731684

For knowing if system uses UEFI, the next command tells

Code: Select all

[ -d /sys/firmware/efi ] && echo "UEFI mode" || echo "Legacy mode"

Qwazert
Level 1
Level 1
Posts: 43
Joined: Tue Dec 03, 2013 2:52 am

Re: Repairing GRUB.

Post by Qwazert »

decrepit wrote:
Tue Jan 07, 2020 6:13 am
A bit more info may help.
What do you mean by won't boot? Do you get into grab at all, a terminal prompt perhaps? Or just a black screen? Is the bios boot priority correct?
Do you still have the install medium?
Here is the issue:
I am planning on replacing my HDD with a SSD. I will need to clone the Windows partition (Linux Mint is on a separate SSD) onto the new drive.
If I repair my bootsector with the Windows commands: bootrec /fixmbr / fixboot I have effectively removed GRUB and the dual-boot option. Now, my PC would only boot into Windows as the GRUB loader is not longer present.
What I want to know, is how to I reinstate the dual-boot option once I have "repaired" the bootsector..?

ravenmad
Level 1
Level 1
Posts: 12
Joined: Thu Jan 17, 2019 11:29 pm
Location: Australia

Re: Repairing GRUB.

Post by ravenmad »

I'm certainly no expert so wait for someone smarter than me to confirm but wouldn't BootRepair from the LiveCD do what you want? Have your Linux install and cloned Win10 disk both connected at the same time as you boot the LiveCD and have BootRepair rebuild GRUB - it should detect the Win install and create the correct entries in Grub. No?

Qwazert
Level 1
Level 1
Posts: 43
Joined: Tue Dec 03, 2013 2:52 am

Re: Repairing GRUB.

Post by Qwazert »

Thank you for your reply.
I just became aware of the Boot Repair live CD and I've downloaded a copy of it.
After running it (without making any changes) it appears that this should fix any problems that I may encounter. I will consider this issue as SOLVED.

decrepit
Level 4
Level 4
Posts: 366
Joined: Mon Dec 03, 2018 4:07 am
Location: Mandurah Western Australia

Re: SOLVED - Repairing GRUB.

Post by decrepit »

If I'm understanding correctly, you'll still have a a working mint OS after you install the cloned windows disk. It should just be a matter of

Code: Select all

sudo update-grub
And bingo, your new windows clone will be in your boot menu.

Post Reply

Return to “Newbie Questions”