Recovering GRUB After Windows Install

0

My power supply came in the mail this week for my Toshiba A200 notebook so I decided to add Windows 7 to the installed OS list (currently booting Leopard 10.5.2 and Ubuntu 9.04).  As always Windows hijacked the master boot record with it’s inferior boot manager – I had to fix this immediately.

GRUB is not as complicated as people make it out to be. In fact it is a very elegant solution to handling multi-boot platforms. Here’s a quick guide to steal your MBR space back from Windows :

  1. Boot into live CD such as Ubuntu or Knoppix – DSL works well and is fast.
  2. Open a terminal, if your live CD boots into a GUI – press ALT+CTRL+F2 to access a different console.
  3. type “cfdisk”

This part is tricky – you must find where GRUB currently lives – in the case of the image below (my rig) sda5 is where Ubuntu is installed – in GRUB this is equal to hd0,4 – since GRUB counts from 0, not 1.

Screenshot

Once you have determined what partition holds grub root files – close cfdisk (q) and type :

grub

root (hd0,X) <– where X is the grub count from 0 to your current Linux installation*

setup (hd0,0)

This will opverwrite Windows MBR installation and give access back to GRUB hooray!  Next step would be adding Windows boot back to grub which has already been covered in my “How To Dual Boot Hackintosh + Ubuntu” article.

* I have a difficult time expressing this simple idea – if Linux is installed on SD5 then grub should say (hd0,4).  If your boot partition is /dev/sda87, GRUB would be (hd0,86) – I hope this helps.

EDIT : I forgot to mention a huge congratulations to Microsoft for making an operating system that looks and feels like Vista with the intermittent stability of XP – huge upgrade IMO.. still far from Leopard.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

Security Code: