iammeagain
February 10th, 2007, 04:25 PM
This is my first how to, if there is anything i messed up on just correct me and if you aren't clear about something just ask. It is a good idea to read some of the stuff other's have posted to see if they had any of the same problems and to give you a better idea of whats going on. Also any suggestions on improvement are great too. Im going to try and get some screen shots eventually.
I haven't had anytime to revise a lot of stuff i left out on this, so this would prbably be easier to understand :
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
DISCLAIMER: Just like with any other tutorial, though its tested and should be safe, if you choose to follow this instructions, you are doing it at your OWN risk! (if that didn't scare you, you may continue...)
I used (K)Ubuntu 6.06 and 6.10 to do this along with Windows XP Professional.
I would expect this to be able to fix other distros of Linux too that use grub.
The easiest way of installing Winblows and Ubuntu together is having Winblows installed first and then installing Ubuntu, but sometimes that isn't an option. If you can I would suggest taking that route instead of this workaround.
Anyways this is for if you have installed (K)Ubuntu and you want to put Winblows back on your system. This can be tricky because only in a few rare cases does Winblows detect another OS. So you will have to reinstall Grub and also partitioning can be a bit scary the first couple times.
Before anything else back up data! I'm not joking, REALLY!
Partitioning and Installing Windows:
First You would want to boot a live (K)Ubuntu CD
Second Once its loaded start gparted, (I think it might be under the System menu then the Administration, but search elsewhere if you don't find it i know its somewhere. If you completely can't find it open a terminal and type in " sudo gparted " (no quotes))
Third With gparted resize your (K)Ubuntu partition, or do it however you want to make another partition for Windows. (I don't believe you need to format it to anything, because you will format it anyways with the windows installer.)
Fourth Tell gparted to apply the changes and reboot.
Fifth You now have to install windows, boot the Windows install CD and choose the right partition. Install it... wait a long time.... (when its done it will have written over your MBR, master boot record, which was grub. So thats why we have to reinstall it.)
Install Grub:
Info Windows erased the Master Boot Record (MBR) so now we have to fix that.
First Boot into (K)Ubuntu live Cd again
Second Open up a terminal, and type in " sudo grub "
Third Type " root (hd0,1) " Replacing the 0,1 with the appropriate #'s. (You need to know what partition (K)Ubuntu is on. If you can't remember opening a new terminal and typing " sudo fdisk -l ", which will list your partitions. So hda1=hd0,0 and hda2=hd0,1 and hdb1=hd1,0 I hope that makes sense its a little tricky to explain.)
Fourth Type in " setup (hd0) " (But replace it with the same thing it was above for you.)
Fifth Type " quit " and reboot everything should be setup. (Once you learn how its not nearly as hard as it seems.)
Sixth OK you need to edit your grub menu to include Windows. I totally forgot that part. I dont have the tiem to add it now but i will later
I haven't had anytime to revise a lot of stuff i left out on this, so this would prbably be easier to understand :
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
DISCLAIMER: Just like with any other tutorial, though its tested and should be safe, if you choose to follow this instructions, you are doing it at your OWN risk! (if that didn't scare you, you may continue...)
I used (K)Ubuntu 6.06 and 6.10 to do this along with Windows XP Professional.
I would expect this to be able to fix other distros of Linux too that use grub.
The easiest way of installing Winblows and Ubuntu together is having Winblows installed first and then installing Ubuntu, but sometimes that isn't an option. If you can I would suggest taking that route instead of this workaround.
Anyways this is for if you have installed (K)Ubuntu and you want to put Winblows back on your system. This can be tricky because only in a few rare cases does Winblows detect another OS. So you will have to reinstall Grub and also partitioning can be a bit scary the first couple times.
Before anything else back up data! I'm not joking, REALLY!
Partitioning and Installing Windows:
First You would want to boot a live (K)Ubuntu CD
Second Once its loaded start gparted, (I think it might be under the System menu then the Administration, but search elsewhere if you don't find it i know its somewhere. If you completely can't find it open a terminal and type in " sudo gparted " (no quotes))
Third With gparted resize your (K)Ubuntu partition, or do it however you want to make another partition for Windows. (I don't believe you need to format it to anything, because you will format it anyways with the windows installer.)
Fourth Tell gparted to apply the changes and reboot.
Fifth You now have to install windows, boot the Windows install CD and choose the right partition. Install it... wait a long time.... (when its done it will have written over your MBR, master boot record, which was grub. So thats why we have to reinstall it.)
Install Grub:
Info Windows erased the Master Boot Record (MBR) so now we have to fix that.
First Boot into (K)Ubuntu live Cd again
Second Open up a terminal, and type in " sudo grub "
Third Type " root (hd0,1) " Replacing the 0,1 with the appropriate #'s. (You need to know what partition (K)Ubuntu is on. If you can't remember opening a new terminal and typing " sudo fdisk -l ", which will list your partitions. So hda1=hd0,0 and hda2=hd0,1 and hdb1=hd1,0 I hope that makes sense its a little tricky to explain.)
Fourth Type in " setup (hd0) " (But replace it with the same thing it was above for you.)
Fifth Type " quit " and reboot everything should be setup. (Once you learn how its not nearly as hard as it seems.)
Sixth OK you need to edit your grub menu to include Windows. I totally forgot that part. I dont have the tiem to add it now but i will later