Installing windows after Linux

Man of Honour
Joined
18 Oct 2002
Posts
20,543
Location
UK
I have a computer here with 2x 120Gb SATA HDDs. I have Ubuntu installed on one and as far as I know the other one is empty.

However, when I open the Disk Usage Analyzer, it shows the "Filesystem capacity" as 212Gb. I haven't set up a RAID array so the two HDD's should be completely separate.

When I browse to "Computer", the drive called "Filesystem" is shown as well as "New Volume" which is unmountable.


Despite all this, I want to install Windows XP on the second HDD which I believe is blank. When I install XP by booting from the CD, how do I get Grub to recognise the installation next time I boot up the computer?

Sorry if this is all a bit noobish!
Thanks :)
 
When you install Windows it will overwrite grub. You can either add Linux to the Windows bootloader using a utility called 'bootpart', available here: http://www.winimage.com/bootpart.htm

Or of course you can reinstall Grub back onto the the MBR. This will require you to boot an Ubuntu live disc, mount the disk and then run 'grub-install' again.

If your disc is /dev/sda and you have just mounted it as /mnt then the grub-install command would be:

grub-install --recheck --root-directory=/mnt /dev/sda
 
When you install Windows it will overwrite grub. You can either add Linux to the Windows bootloader using a utility called 'bootpart', available here: http://www.winimage.com/bootpart.htm

Or of course you can reinstall Grub back onto the the MBR. This will require you to boot an Ubuntu live disc, mount the disk and then run 'grub-install' again.

If your disc is /dev/sda and you have just mounted it as /mnt then the grub-install command would be:

grub-install --recheck --root-directory=/mnt /dev/sda

2 different disks, so 2 bootloaders etc
 
The main problem you'll face, as above, is Windows overwriting the MBR. Just edit the windows boot.ini to include your Ubuntu install.

2 bootloaders :confused:?

He's got 2 disks, linux on 1 and windows to go on the other. He wont overwrite grub as its not going on the linux disk

edit: ok bootloader was perhaps misleading- i was just matching terminology of the quoted text. MBR :)
 
Last edited:
He's got 2 disks, linux on 1 and windows to go on the other. He wont overwrite grub as its not going on the linux disk
If you install windows over linux it will overwrite the master boot record which is on the first disk.

Much like linux will overwrite the mbr of a windows install; the difference being that linux can handle adding a bootpath to windows as well.
 
If you install windows over linux it will overwrite the master boot record which is on the first disk.

Much like linux will overwrite the mbr of a windows install; the difference being that linux can handle adding a bootpath to windows as well.

You miss read the OP I think,

I have a computer here with 2x 120Gb SATA HDDs. I have Ubuntu installed on one and as far as I know the other one is empty.

However, when I open the Disk Usage Analyzer, it shows the "Filesystem capacity" as 212Gb. I haven't set up a RAID array so the two HDD's should be completely separate.

When I browse to "Computer", the drive called "Filesystem" is shown as well as "New Volume" which is unmountable.


Despite all this, I want to install Windows XP on the second HDD which I believe is blank. When I install XP by booting from the CD, how do I get Grub to recognise the installation next time I boot up the computer?

Sorry if this is all a bit noobish!
Thanks

He's not installing linux over windows or vice versa. 2 Disks, 2 OSs, 2 MBRs.

Obviously you can only boot to 1 disk (the linux disk). This pulls up grub which can boot linux in the usual way or boot windows by mapping hd0->hd1 and hd1->hd0 as explained in that link. This passes over to NTLDR which boots itelf as usual on disk 2
 
Scuzi, do you want to have just one bootloader with options to start either Linux or Windows, or are you happy switching the drive to boot from in your BIOS whenever you want to boot one instead of the other?
 
Yes but you can only have 1 mbr active, depending on which hdd you set to boot from, and windows will always try to overwrite the mbr of the primary hdd. If grub is on this disk, it'll get overwritten.

Either way, you can set either bootloader to boot into either hdd. Not sure why you'd need or want 2 bootloaders as you'd need to flip between boot priority in the bios. So he can either set up grub that way or even easier just modify the windows one.
 
Yes but you can only have 1 mbr active, depending on which hdd you set to boot from, and windows will always try to overwrite the mbr of the primary hdd. If grub is on this disk, it'll get overwritten.

:confused: Windows wont overwrite grub unless you install windows to a partition of that disk. Which he isn't.

Either way, you can set either bootloader to boot into either hdd. Not sure why you'd need or want 2 bootloaders as you'd need to flip between boot priority in the bios. So he can either set up grub that way or even easier just modify the windows one.

You have 2 MBRs like it or not, as you have 2 disks. You don't need to change the boot priority, you leave it pointing to the linux disk (well i'd rather use grub). This then points to its own partition for linux, and the 2nd disk as you mentioned.

so: bios -> boot disk1 (linux/grub etc) -> grub menu: Linux (disk1,part1) & Windows (disk2,part1)
 
Clean way of doing it:

1) Unplug Ubuntu disk / disable in BIOS
2) Install Windows on second disk
3) Plug-in / enable Ubuntu disk in BIOS
4) Boot from Ubuntu Disk
5) Edit /etc/grub/menu.lst to point to Windows on second drive
6) Reboot and test - making sure Ubuntu disk is first in boot order
 
Clean way of doing it:

1) Unplug Ubuntu disk / disable in BIOS
2) Install Windows on second disk
3) Plug-in / enable Ubuntu disk in BIOS
4) Boot from Ubuntu Disk
5) Edit /etc/grub/menu.lst to point to Windows on second drive
6) Reboot and test - making sure Ubuntu disk is first in boot order

Exactly
 
:confused: Windows wont overwrite grub unless you install windows to a partition of that disk. Which he isn't.
I must be being a complete idiot then, as I'm thinking it will overwrite the mbr on disk 1, regardless of what disk you install it too? And I'm assuming he has his Ubuntu disk as disk 1 because he's using that. Therefore if he installs windows to disk 2, it will overwrite the mbr on the primary disk; disk 1.

You're right though that using Grub is the best, I just thought Scuzi would probably find editing the boot.ini easier then grub.

Edit: Apologies Scuzi for slightly derailing your thread..
 
I must be being a complete idiot then, as I'm thinking it will overwrite the mbr on disk 1, regardless of what disk you install it too? And I'm assuming he has his Ubuntu disk as disk 1 because he's using that. Therefore if he installs windows to disk 2, it will overwrite the mbr on the primary disk; disk 1.

You're right though that using Grub is the best, I just thought Scuzi would probably find editing the boot.ini easier then grub.

Edit: Apologies Scuzi for slightly derailing your thread..

Yeah sorry it was a bit inconsiderate to argue out the finer points in detail :D

It should install NTLDR to the MBR of the disk you select in the partition menu, However I'd always disconnect the other disk (especially when you have 2x 120gb of the same make) as you can't tell which is which and could wipe the wrong one
 
Aye, disconnecting the disk will do it just fine. But I was also assuming he didn't want to mess around inside his PC.

Scuzi, read posts #2 and #3, ignore the rest :p.
 
No need to apologise, I have learnt a thing or two from the discussion :)

Just to be sure, my options are:
1 - Install windows on the second blank drive and after the install, edit the boot.ini to also point to the Linux install.
2 - Remove the Linux drive, install Windows on the blank drive and when it is installed, edit the Grub bootloader to point to Windows.

Is that right?
 
option 2 is the easiest. when you change the boot order in bios windows bootloader works fine as it is unaffected by grub.
could be useful if you mess up your grub and want to go back to windows.

I would also get acquainted with a linux boot cd called Super Grub Disk.
it will fix any grub problems you have, everyone needs it from time to time. keep it handy in case you mess up grub.
 
I would also get acquainted with a linux boot cd called Super Grub Disk.
it will fix any grub problems you have, everyone needs it from time to time. keep it handy in case you mess up grub.
That's true. I heard about it from someone on these very forums, and it has saved my bacon on a couple of occasions.
 
Back
Top Bottom