Related Posts Plugin for WordPress, Blogger...

Wednesday, December 8, 2010

Restore or Reinstall Ubuntu grub after reinstalling Windows

If we reinstall windows on a Windows/Ubuntu dual boot system, we can not use Linux, until the Grub (GRand Universal Bootloader) is restored.

To restore grub, Insert the live CD/DVD of Ubuntu and restart the system to start a live session.




For Ubuntu versions 9.10 and above:

Then open a terminal from Applications --> Accessories --> Terminal and enter the following command.
Code:
sudo fdisk -l
You will see something like this:

http://i51.tinypic.com/2j67dd2.png


Select the drive in which root partition "/" is installed.. (Let us say /dev/sda5)

Then in terminal

still in the terminal, type:
Code:
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5
And then, to reinstall the grub by entering:
Code:
sudo grub-install --root-directory=/media/sda5 /dev/sda
Of course you need to replace “/dev/sda5″ and “/dev/sda” with what you found in the fdisk output.


If you get BIOS warnings try:

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

If everything is fine type in the following into terminal:

Code:
sudo reboot




For Ubuntu versions 9.04 and lower:

We need to open terminal from

Applications --> Accessories --> Terminal and enter the command.

Code:
sudo grub
Next,

Code:
find /boot/grub/stage1
Take note of what it returns (something like (hd0,1).)

Now enter

Code:
root (hda,b)
Replace a and b with what you got back before. For example, if "find /boot/grub/stage1" gives "(hd0,3)", you will run "root (hd0,3)"

Now run:

Code:
setup (hd0)
This is fine if you want to write GRUB to the MBR. If you want to write it to your Linux root partition, then you want the number after the comma, such as "(hd0,3)".



If everything is fine type in the following into terminal:

Code:
sudo reboot
Enjoy...



Please give your valuable comment for further improvement...


3 comments:

  1. Though the technical glitch scared a lot of people. It was just a publicity stunt to make the event even more interesting. The intention was good the question is. Is it necessary to make a fuss just before the big event? I don't think so.jogos online 2019
    friv jogos 4 school online
    jogos friv gratis 2019
    abcya club unblocked

    ReplyDelete
  2. Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others like you helped me. apple service provider berlin

    ReplyDelete