How do I reinstall grub2?
56,821
Solution 1
Try this to recover grub:
- Open the live version of Ubuntu (either burn the LiveCD or install the image to a bootable USB device using Startup Disk Creator);
- Open terminal and run
sudo fdisk -l
to see where Linux is installed on; - Run
sudo mount /dev/sdxY /mnt
where x is altter and Y a number you have found in the previous step; - Run
sudo grub-install --root-directory=/mnt /dev/sdx
to install grub; - Run
sudo update-grub
to update grub; - Run
sudo shutdown -r now
to reboot.
Solution 2
GUI way
In addtion to the other answers, a way with graphical user interface would be to boot from LiveCD or a bootable USB device (putting the live .iso on there with Startup Disk Creator ).
Once in the Live session you can install Boot-Repair:
sudo add-apt-repository ppa:yannubuntu/boot-repair \
&& sudo apt-get update \
&& udo apt-get install -y boot-repair \
&& boot-repair
Then start Boot-Repair from Dash and click "Recommended Repair" or take a look at the other options.
Use at your own risk. The usual warnings with non-official repositories apply.
Related videos on Youtube
Author by
eekfonky
Updated on September 18, 2022Comments
-
eekfonky almost 2 years
Having tried all day to reinstall grub and trawling the internet I have had no luck. I can no longer boot into ubuntu and have tried boot disk frin yannubuntu but the grub tabs are greyed out. Other methods will not install it on sda1. I have no other os to boot into but have a live usb. Please help
-
eekfonky over 12 yearsTried that and it doesn't work. I get it reboot. Then it pops up with 'BASH...ETC.' and a 'grub>'
-
eekfonky over 12 yearsSorry. On my mobile as computer is down. Will try to be as specific as possible. I have a photo I took of the screen. Shall i Upload it somewhere?
-
Knowledge Cube over 12 years@Eekfonky If you have a screenshot, you can upload it to an image-sharing site of your choice (such as imgur, which we use as the default uploader here), and edit the link to your picture back into your question. One of us can then properly edit the screenshot back into the question so it is visible.
-
Knowledge Cube over 12 years@Eekfonky Additionally, if you are getting a
grub>
prompt to appear after a failed reinstall, you may want to take a look at this and see if it helps. -
con-f-use almost 12 yearsA better way might be to boot from LiveCD,
chroot
intro the broken installation and run grub-install/update-grub from there.