Recovery Grub Legacy boot loader from grub-shell

All you need to do is access the terminal using the installation CD/DVD of your GNU/Linux operating system or to do the boot over network with RIPLinux. Once you are in the terminal, you will have to access the ‘grub’ shell to change the grub configuration:

# grub

You will get the grub-shell prompt:

grub>

Now, you will have to find out in which partition Grub had been installed before, so that you reinstall in that partition only. Give this command at the terminal:

grub> find /boot/grub/stage1

It returns the number of the partition in which Grub i.e your GNU/Linux had been installed.

grub> find /boot/grub/stage1
(hd0,2)

Before reinstalling Grub, you will have to notify the partition that your Grub i.e. GNU/Linux is resided in. So, give this command at the terminal:

grub> root (hd0,2)

Now, reinstall grub in the MBR i.e. the returned value without number part.
So, give this command at the terminal:

grub> setup (hd0)

Exit the grub-shell prompt using “Ctrl+c”.
Exit the shell prompt using “Ctrl+d”.

You can also reinstall Grub in your GNU/Linux partition, only if this GNU/Linux partition is “primary” and you have another boot loader installed at the MBR(in case of more than one GNU/Linux operating systems) through which you can boot this primary partition. To do that, give this command at the terminal:

grub> setup (hd0,2)

Scroll to top