Repair Grub from inside the system (not using CD)

1

I was playing with Debian Jessie, installed it on a USB drive and (almost) everything was ok.

In the end I noticed the original Grub (in the laptop's SSD) was over written.

I'm able to login into Ubuntu 15.04, which is installed in the laptop SSD via the new Grub, actually installed in the USB. In other words, now I need the USB inserted to boot into the old system.

I would like to be able to log into the old system without the USB, using the Grub installed in the laptop's SSD.

Question, how to repair Grub?

P.S.: I was used to do this kind of thing in LILO, just a matter o executing lilo. But Grub is kind of new to me.

KcFnMi

Posted 2016-05-28T18:15:12.393

Reputation: 396

I wonder what went wrong. When you say "I need the USB inserted to boot into the old system", do you mean "I boot from SSD and Grub needs files on USB" or "I have to boot from USB because booting from SSD doesn't work at all"? – Kamil Maciorowski – 2016-05-28T18:56:45.487

I mean "I have to boot from USB because booting from SSD doesn't work at all", in fact it goes to rescue mode. – KcFnMi – 2016-05-28T19:07:47.793

Answers

0

The simple form is:

sudo grub-install /dev/sda

where /dev/sda is the device you want to install grub on. This assumes the right place to install grub images is /boot/grub/. Otherwise refer to man grub-install and use --boot-directory option.

Kamil Maciorowski

Posted 2016-05-28T18:15:12.393

Reputation: 38 429