PDA

View Full Version : [SOLVED] Dual Boot Question



linux.girl
November 22nd, 2016, 08:00 PM
Hello friends,

I have a PC with 2 separate hard drives. One is 1 T and it has Ubuntu 16.04 installed in it. The other is 160 GB and has windows 7 installed in it. When I turn on my PC, grub sees both ubuntu and windows (on /dev/sdb2) and lets me choose which system I want to boot first.

(so it is not a classic dual boot in the sense that you have two OS on the same hard drive - I have one OS on each hard drive in separate).

When I originally installed, I did first Windows and then Ubuntu, to make sure GRUB would be ok.

The problem now is that my win 7 is "broken" and I have to re-install it. The question is how to do it without harming ubuntu and GRUB.

If I do a simple re-install with the win 7 disk and choose the correct 160GB drive, will GRUB continue to recognize the windows?

Any other precautions, preparations I should do or worry about?

Thanks in advance,

linux.girl

RobGoss
November 22nd, 2016, 08:21 PM
Hello and welcome, reinstalling Windows after Ubuntu has been installed may cause your machine to not boot in to your Ubuntu OS

You will have to also update the grub boot loader after reinstalling Windows 7 it will over ride the grub boot loader

I believe the grub installs to the MBR Windows partition therefore it will be overridden by the reinstallation of Windows 7

I'm sure there will others with a better explanation to how this works

howefield
November 22nd, 2016, 08:35 PM
If I do a simple re-install with the win 7 disk and choose the correct 160GB drive, will GRUB continue to recognize the windows?

If grub is installed on the Ubuntu disk the worst you should have to do is update grub if it doesn't see the Windows installation.

Repairing your Windows install is out of the question then ?

RobGoss
November 22nd, 2016, 08:49 PM
The problem now is that my win 7 is "broken" and I have to re-install it. The question is how to do it without harming ubuntu and GRUB.



I would try fixing your Windows before attempting to reinstall Ubuntu it might make things a lot easier if it can be fixed

linux.girl
November 22nd, 2016, 08:51 PM
Hi,

Yes, GRUB is installed on the Ubuntu disk. Repairing windows did not work, I really have to re-install. But if you say the max that will happen is to update grub (so it sees the windows) then I guess it is not that bad.

Thank you so much!

I will do the re-install and report back on how it goes.

EDIT: I will not re-install ubuntu, it is on a different disk (two disks on the same pc, one with ubuntu and one with windows)

Mark Phelps
November 22nd, 2016, 09:39 PM
If Ubuntu is on a different disk, then all you have to do is the following:
1) Remove the Ubuntu disk from the PC
2) Reinstall Windows
3) Reconnect the Ubuntu disk to the PC
4) Set your PC to boot from the Ubuntu disk
5) Once in Ubuntu, open a terminal and enter "sudo update-grub". This will regenerate the GRUB configuration files and when you then reboot, you will see a GRUB menu with entries for Ubuntu and Windows.

Good Luck

yancek
November 22nd, 2016, 10:57 PM
Yes, GRUB is installed on the Ubuntu disk.

But is Grub code in the MBR of the Ubuntu disk or the windows disk (if this is an MBR install). Which drive is set to first boot priority? You could install Grub on Ubuntu and still have Grub code in the MBR of the windows disk if it is set to first boot priority. If you are sure Grub is installed to the MBR of the Ubuntu disk, then the suggestion above by Mark Phelps would definitely be the safest method.

oldfred
November 22nd, 2016, 11:20 PM
If you reinstall Windows is is vital you have Windows drive as default in BIOS if BIOS install.
Windows will create a 100MB boot partition on the BIOS default drive. Since it does not see Linux partitions, it just uses the first 100MB of Boot drive potentially overwriting part of your Ubuntu install and destroying it.

Best to disconnect Ubuntu drive. Then in Ubuntu run a new sudo update-grub to find the new Windows install and add it to grub menu.
Also best to keep Windows boot loader on Windows drive and grub boot loader on Ubuntu drive.

And if Windows only install it will be first drive, best then to keep it as first drive on SATA0 port.

linux.girl
November 23rd, 2016, 12:18 AM
Thank you all so much for the helpful tips - disconnecting the ubuntu drive seems to be definetly the safest way to go. GRUB is installed on the ubuntu drive only. The first priority is the Ubuntu drive. As of now, grub comes up after I turn on the PC and shows me the GRUB menu with the options of either continue loading ubuntu or load the windows. I guess if I disconnect Ubuntu, re-install windows and then do update grub as Michael Phelps suggested (aslways keeping the ubuntu as first priority) then it should be OK.

I will try it this week and let you all know how it went.

Thanks again for all the help!

Mark Phelps
November 23rd, 2016, 01:02 AM
It's "Mark" not "Michael" -- the SECOND one is the Olympic Gold Medalist. :)

linux.girl
November 23rd, 2016, 05:03 PM
Ooooooops!!!!! Super sorry!!! :-) :-) :-)

linux.girl
November 28th, 2016, 05:56 PM
Hi Guys,

Suggestion by Mark Phelps worked. I disconnected the HD where ubuntu is installed, re-installed windows on the other HD, reconnected the ubuntu HD, updated grub and all is working fine.

Thanks everyone for all the help, marking this thread as solved.

Cheers!

RobGoss
November 28th, 2016, 06:01 PM
Glad you were able to get things running