Re-installing Grub to MBR. How?

New to SolydXK? This is the place to start.
Please check the other subforums to see if there's a more suitable place for your question.
tavies678
Posts: 71
Joined: 21 Nov 2013 03:00

Re-installing Grub to MBR. How?

Postby tavies678 » 18 Dec 2015 05:38

Hello,

Today's updates resulted in me having the screen stuck at "Configuring grub-pc". I later found out that this is because last year I somehow installed grub in root partition, let's say /dev/sda5. During re-installing June 2015 version of SolydK, I put grub in the MBR. However, after "apt-get update && apt-get dist-upgrade" when prompted I made the same mistake of installing grub in the root partition instead of MBR. I forgot that I would have to hit the space bar to make the choice of where to put grub, i.e. an asterisk will appear on the blue square besides the menu item. Just hit Enter will not work.

Anyway, my SolydK is now working, but I just want to avoid the hassle described above, when next time there's an update to grub. How to I put grub in the MBR NOW?

Thanks in advance for your help.

wayne
Posts: 178
Joined: 25 Feb 2013 14:58

Re: Re-installing Grub to MBR. How?

Postby wayne » 18 Dec 2015 06:04

I just want to avoid the hassle described above, when next time there's an update to grub.

How to I put grub in the MBR NOW?
Assuming you are not installing in UEFI mode...

You are in msdos or legacy mode, then the way to put grub in MBR is:

1. Boot computer with the Live DVD or Live USB flash.

2. Open a terminal, assuming that your root is as you have mentioned on /dev/sda5.
let's say /dev/sda5
3. Mount your root partition with the code

Code: Select all

sudo mount /dev/sda5 /mnt
4. Write grub to MBR of the first drive with this code

Code: Select all

sudo grub-install --root-directory=/mnt /dev/sda 

5. you should see a terminal response with something similar to the following:

Code: Select all

Installing for i386-pc platform.
Installation finished. No error reported.
that is it.
reboot and hopefully the computer will boot from MBR of the first drive.


Return to “Newbie Questions”

Who is online

Users browsing this forum: No registered users and 1 guest