Windows 7 upgrade and Grub boot loader

1

1

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?

Skizz

Posted 2009-10-27T12:12:03.140

Reputation: 992

Answers

3

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.

John T

Posted 2009-10-27T12:12:03.140

Reputation: 149 037

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 – 2009-10-27T12:33:19.270

That looks good. I'll give it a go. – Skizz – 2009-10-27T14:31:37.537

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 – 2009-11-11T12:33:02.950