The morning after

Tuesday, December 25, 2007

Recovering Ubuntu after a Windows installation

what follows is a small step-by-step guide on how to recover the ability to boot your Ubuntu partition after a new Windows installation

problem: Windows overwrites the Master Boot Record (MBR), effectively destroying any LILO or GRUB setup you might have had; contrary to what several websites claim: just setting the proper partition active will NOT fix the problem

why: I've had this problem several times in the past and I've used different ways of being able to recover my dual-boot capability, I Googled for a solution each time again, this time I hope to win some time by keeping track of what I did the last time

solution: reinstall LILO or GRUB

how: we'll be reinstalling GRUB so that the original boot screen is shown again at startup

  1. pop-in your Ubuntu Live CD and wait for Ubuntu to have loaded
  2. open a terminal
  3. type sudo grub and hit enter, this will open a new interactive context within your terminal
  4. now type find /boot/grub/stage1 and hit enter, this will print a string in the console, in my case it printed (hd0,2), we'll be using this string in the following steps .. if something else is printed in your console then substitute my string in what follows
  5. type root (hd0,2) and hit enter
  6. type setup (hd0) and hit enter again
  7. finally type quit and hit enter to exit the GRUB console
at this point the GRUB information should have been written to the proper partition (just as it was before the Windows installation), restart your system and make sure the Ubuntu Live CD is ejected before the system actually reboots

I had to reboot twice for everything to properly work, for some reason Ubuntu presented a black screen with a blinking cursor the first time

0 Comments:

Post a Comment

<< Home