Posted by: Tito | November 1, 2009

Reinstalling Grub 2

“Error loading operating system.”

This error appeared on the screen where the grub menu should be. As far as I can remember, all I did was deleting and creating an empty partition that I had prepared for installing windows. However, I couldn’t manage to install it because this partition was in an extended part of the harddisk and Windows can be installed only on primary partition. So, I quit the installation … and saw this message after restarting.

After googling hopelessly for a long time, I found the solution.

Boot the system with live cd then open the terminal and type

$sudo fdisk -l

Check where the root and boot partition of linux are.

Mount the root partition. In my case it’s sda1

$sudo mount /dev/sda1 /mnt

Mount the boot partition, if there is any.

$sudo mount /dev/sda1 /mnt/boot

Bind them.

$sudo mount –bind /dev/ /mnt/dev    (Note: there are two ‘-’ before bind)

$sudo chroot /mnt

$grub-install /dev/sda

$grub-install –recheck /dev/sda

Unmount. LIFO.

$sudo umount /mnt/dev

$sudo umount /mnt/boot (if you mounted it)

$sudo umount /mnt

And reboot the system.


Responses

  1. Thanks man! :)
    You have saved me from a lot of desperation ;)
    And rescued my computer :)

    Thanks!

    E-mol


Leave a response

Your response:

Categories