Donate

Repair GRUB2 When Ubuntu Won't Boot

Repair GRUB2 When Ubuntu Don't Boot

Ubuntu and many other Linux distributions use the boot loader (boot loader) GRUB2. If GRUB2 is corrupt - for example, if you install Windows after the installation of Ubuntu, or you replace the MBR - you will no longer be able to boot into Ubuntu.
To fix this I'll share with you two methods, a graphical method, and another via the command line.

Graphical method:

Boot Repair is a graphical tool that allows to fix GRUB2 in one click. This is the ideal solution to problems starting for most users.
All you have to do is to download the live CD of Ubuntu if you have not already and burn it to a CD or boot to a USB key, and then insert the cd or USB key into your computer and restart.
After starting in the boot of Ubuntu live, open a terminal and run the following commands to install Boot Repair:
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair
boot-repair
The Boot Repair program window appears after running the command 'boot-repair. Once started, the tool scans your system, wait until the scan is complete and click recommended repair (Recommended Repair) to fix GRUB2 in one click.
bootrepair repair grub2 ubuntu
You can also click on advanced options to customize GRUB2 options without having to learn the command line syntax.
bootrepair grub
Once the magic of Boot-Repair is complete, restart your computer, Ubuntu should start normally.

Fix GRUB2 via the command line:

If you prefer to get your hands dirty, you can fix grub2 yourself from a terminal. You will need to boot from a Live CD or a USB key. Make sure that the version of Ubuntu on the CD is identical to that of Ubuntu installed on your computer - for example, if you have installed Ubuntu 14.04, you'll have to use a live CD Ubuntu 14.04.
After starting in the live environment, open a terminal and use the following command to identify the partition where Ubuntu is installed.
sudo fdisk -l
Here is the result of the command, the Ubuntu partition is identified by the word Linux in the system column. Note that I have two Linux distributions installed on my computer and I want to fix is selected in blue.
repair boot ubuntu
Run the following command to mount the Ubuntu partition. Do not forget to replace /dev/sdX # with the device name of your partition Ubuntu you just identify with the fdisk command :
sudo mount /dev/sdX# /mnt
partition Linux
Important: If you have a boot partition, skip the above command and mount the boot on/mnt/boot partition. If you are unsure if you have a boot partition, you probably not have it.
Run the following command to reinstall grub from Live CD, to replace sd/dev/sdX with the device of the hard drive name above. Omit the number. For example, if you use sda5/dev/sda5 above, use sda/dev/sda here.
sudo grub-install –boot-directory=/mnt/boot /dev/sdX
repair ubuntu boot via the command line
Restart your computer, Ubuntu should boot correctly.

No comments

Powered by Blogger.