Need advice for preserving GRUB boot loader.

Asked by Myroslav

Greetings,

I am running a system with two separate hard drives. On sda1 I am using Windows xp 32bit and on sdb1 I am using Ubuntu 10.04 64bit. There are no other operating systems on either drive. My Grub version is 1.98 1UBUNTU10.

For work-related reasons I intend to replace xp with Windows 7 Ultimate 64bit (clean install) on sda1. How will this affect GRUB? Is there anything special I should do to be able to make sure that I can get to GRUB after I have made the Windows 7 installation?

I am hoping that on reboot after installing Windows 7, I will be taken to the GRUB menu, select Ubuntu and while in Ubuntu, update GRUB - issue solved. However, I have a lurking fear that the Windows7 installation might have unwanted consequences for GRUB and my access to Ubuntu.

I thank you in advance for your advice.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
Myroslav
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Ubfan (ubfan1) said :
#1

You can install grub onto sdb, then when windows 7 install destroys the grub on sda, you can change the boot order in your BIOS to boot off sdb first. Boot Ubuntu, then run sudo update-grub to replace the old Windows grub info with the new windows 7 info, and you are done. No need to touch sda again, leaving it a pure Windows disk, with the windows boot loader.

Revision history for this message
Myroslav (mgalan) said :
#2

Thank you Ubfan for the reply.

Could you please explain to me how to install grub on sdb?

M

On 11-03-11 08:23 PM, Ubfan wrote:
> Your question #148729 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/148729
>
> Status: Open => Answered
>
> Ubfan proposed the following answer:
> You can install grub onto sdb, then when windows 7 install destroys the
> grub on sda, you can change the boot order in your BIOS to boot off sdb
> first. Boot Ubuntu, then run sudo update-grub to replace the old
> Windows grub info with the new windows 7 info, and you are done. No
> need to touch sda again, leaving it a pure Windows disk, with the
> windows boot loader.
>

Revision history for this message
delance (olivier-delance) said :
#3

https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
   sudo mount /dev/sdb1 /mnt
   sudo grub-install --root-directory=/mnt /dev/sdb

Revision history for this message
Myroslav (mgalan) said :
#4

Thank you Ubfan and Delance for your responses.

I found the instructions I needed here: https://help.ubuntu.com/community/WindowsDualBoot

Things look good. I will close this thread as solved.

Thanks again and the best to you.

Revision history for this message
Myroslav (mgalan) said :
#5

Thanks Ubfan, that solved my question.

Revision history for this message
Myroslav (mgalan) said :
#6

Dear Delance,

I must have done something wrong. I followed your instructions. when I rebooted after that, I do not get a grub menu but this:

Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename.

This is booting from sda1

I don't know what to do now. I can't get into either xp or ubuntu 10.04. I'm writing this from a live session using my installation disk with which I can access all my files on both hard drives. I know nothing about programing.

Please help me get my grub back.

Revision history for this message
Ubfan (ubfan1) said :
#7

You could try booting from sdb instead of sda, but if your sdb setup somehow got partially written to sda, the sdb setup probably is not working either. From your live CD, you just need to follow delance's instructions above to install grub onto sdb, and that should boot both windows and ubuntu -- but you have to tell your computer to try sdb before trying sda. Usually you can change a setting in the BIOS setup to do this, or at the first vendor splash screen at boot time, you might have instructions to type a key (ESC for example) to select a boot device.
  If you can successfully boot from sdb, you can backup your XP files, and reinstall Win 7 onto sda, which should fix the bootloader on sda. After installing win7, sda should boot win7 with no sdb attached. When you next run ubuntu, run
sudo update-grub to change the xp boot info to win7 boot info.

Revision history for this message
delance (olivier-delance) said :
#8

The most direct should to install Seven, and then use a Live Session, and follow instruction in https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD to reinstall on first disk on boot order . It's usually sda but sometimes it can have another value. If you want to preserve Seven MBR, the solution is to install Seven on first disk, then switch both disks in boot order, and then to reinstall Grub2.

Revision history for this message
Myroslav (mgalan) said :
#9

Dear Delance and Ubran,

Thank you for your help. It was kind of you to spend the time and to be so patient. My efforts were not very successful so I went ahead and installed Windows 7 and installed Ubuntu 10.10 afterwards. I had all my files and settings backed up. I lost about a half a day.

The best to you.