Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently have a PC with Vista and Ubuntu installed, using the Grub boot loader to select the OS. The two OSes are on separate partitions.

If I were to ugrade the Vista installation to Windows 7, will it affect the grub loader? If it does, how would I re-instate the grub loader after the update?

share|improve this question
up vote 3 down vote accepted

Yep, Windows 7 will break your GRUB. You can get it back like so:

1) Boot off the LiveCD

2) Open a Terminal and type in the following commands, noting that the first command will put you into the grub “prompt”, and the next 3 commands will be executed there. Also note that hd0,0 implies the first hard drive and the first partition on that drive, which is where you probably installed grub to during installation. If not, then adjust accordingly.

sudo grub

> root (hd0,0)

> setup (hd0)

> quit

Reboot (removing the livecd), and your boot menu should be back.

Check The How-To Geek's guide for more details, in case you don't see Windows in the boot menu after this configuration.

share|improve this answer
You should use grub> find /boot/grub/stage1 to find where root is. And grub uses quit, not exit, as I found out yesterday – TonyUser Oct 27 '09 at 12:33
sounds about right, thanks! – John T Oct 27 '09 at 12:35
That looks good. I'll give it a go. – Skizz Oct 27 '09 at 14:31
An extra note: if, like me, you forgot which partition number Ubuntu was installed on, typing "root (hd0," and then <tab> displays the available partitions, just pick the one that it identifies as a readable partition (it doesn't recognise the NTFS partitions). – Skizz Nov 11 '09 at 12:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .