Grub Rescue Error. I can boot but need to enter commands again and again [duplicate]

Solution 1:

To repair the Grub bootloader, try these steps.

1 - Live CD

First, you'll need to boot from a Ubuntu Live CD.

2 - Repair the bootloader

Open a terminal from the Live CD, and run the following commands:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair
boot-repair

After a few seconds, Boot Repair's main window will open.

Click on Recommended repair.

You're done!

Reboot to test everything out.

If everything went well, you should be up and running now. If not, keep going.

Command-line version

If the above fails, you can also use the command line (from a Live CD) to reinstall Grub.

Important: Replace sda1 with the partiton that contains Ubuntu and sda with the drive that contains Ubuntu's partition

sudo mount /dev/sda1 /mnt
sudo grub-install --root-directory=/mnt/ /dev/sda
*edit* at this point, also ensure that if /usr and /var are on seperate partitions that you mount them to /mnt/usr and /mnt/var
*edit 2* whithin the chroot you need to have /dev /run and /proc available for update-grub to work, use the following to acheive that: for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
sudo chroot /mnt
sudo update-grub
sudo reboot