Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.