Can't boot into Ubuntu after installing Windows

7,702

How to restore the Ubuntu grub bootloader (9.10 and beyond)

First you need to find out what your drives are called. You can do this by going to a terminal and typing:

sudo fdisk -l

From that you need to find the device name of your Ubuntu drive, something like “/dev/sda5″. So, still in the terminal, type:

sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5

And then, to reinstall the grub:

sudo grub-install --root-directory=/media/sda5 /dev/sda

Push enter and you’re done! Of course you need to replace “/dev/sda5″ and “/dev/sda” with what you found in the fdisk output.

This is extracted from http://ubuntuforums.org/showthread.php?t=1014708 thread by talsemgeest.

Share:
7,702
bsanneh
Author by

bsanneh

Updated on September 17, 2022

Comments

  • bsanneh
    bsanneh almost 2 years

    Possible Duplicate:
    How can I repair grub? (How to get Ubuntu back after installing Windows?)

    Recently I reinstalled Windows XP on my laptop which also have Ubuntu 9.10 installed, but after reinstalling Windows I was not able to boot to the Ubuntu again.

    I have the Ubuntu 9.10 Live CD with me and I tried some of the tutorials I saw online but was not successfully. For example I followed the examples on this site but I couldn't make it work. Can somebody please help me?

    • TreefrogInc
      TreefrogInc almost 13 years
      Windows XP might have overwritten some files it didn't recognize. It's always recommended to install Windows before Ubuntu, and any older versions before installing a newer one.
  • Simon
    Simon over 12 years
    It's encouraged that answers are somewhat self-contained so that you explain or summarize links instead of just providing one without giving any explanation.