Fix GRUB2 (after installing another OS / Linux distribution or after a GRUB failure)

To fix GRUB 2, you need an Ubuntu live CD from which you need to boot. Once you boot to the LIVE CD, open a terminal an and type these commands:

Firstly, you need to find out on which partition your Linux system is installed:

sudo fdisk -l

Now, we must mount this partition:

sudo mount /dev/sda1 /mnt

Where “sda1” is the partition where you installed Ubuntu (or any other Linux distro). It could be “sda5”, “sda6”, etc. for you.

Install grub to the partition you’ve mounted:

sudo grub-install --root-directory=/mnt/ /dev/sda

Important: Please notice that it’s “/dev/sda”, not “/dev/sda1”. “sda” is the hard disk on which your Linux distribution is installed!

Restart your computer. As previous Grub 2 entries are removed, run the following command to restore them:

sudo update-grub
Print Friendly, PDF & Email

More Like This


Categories


CentOS Linux SliTaz Ubuntu / Mint Web Hosting
  • Post a comment