15

I purchased a PC six months ago for work related tasks. I do 95% of my work on Ubuntu (web development). Now, I want to install Windows on another partition to play a few games on my relax time. Which steps should I follow? Any suggestions? Every guide I found suggest to install Windows and, after that, Ubuntu. Being this my main development machine, I cannot afford the risk of wiping everything.

Jjed
  • 13,874
fedeisas
  • 271

3 Answers3

19

First, back up your data. Keep in mind, when installing an OS, over writing data is often a mouse click away.

Second, boot the ubuntu desktop CD, resize your partitions, and make a NTFS partition for Windows.

Then install Windows into the NTFS partitions. You may need to find drivers for your hardware.

Then boot the Ubuntu CD again and re-install grub. You can do this graphically with boot-repair

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

See https://help.ubuntu.com/community/Boot-Repair for details.

enter image description here

Panther
  • 102,067
  • 1
    Shouldn't sudo update-grub be enough? Why the need for the repair tool? – bioShark Jan 04 '12 at 23:12
  • 1
    You can install grub from the command line if you wish. I choose the graphical method is advised on the ubuntu wiki https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows. – Panther Jan 04 '12 at 23:19
  • It's not me with the issue, I'm just a bystander checking new ideas :). But all in all, good tip about the UI Tool. – bioShark Jan 04 '12 at 23:20
  • boot-repair seems popular, check it out. In addition to re-installing grub you can set a few options. – Panther Jan 04 '12 at 23:22
  • 2
    boot-repair is the de facto tool for the job, if a user is asking how to install Windows after installing Linux a GUI tool is the way to go ;) – Bruno Pereira Mar 14 '12 at 09:49
  • 1
    "Keep in mind, when installing an OS, over writing data is often a mouse click away."

    i learned this the hard way when I accidentally deleted the win8 partition on a laptop when I tried to install ubuntu.

    when there is a pre-existing os installed on your system, i recommend that your perform the partitioning of your disk yourself...

    – ultrajohn Aug 11 '13 at 05:06
0

Check out this

As pointed out in that answer it's impossible to partition 100% safely, consider a backup if you can't afford any risks. Anyways it is quite unlikely something will go wrong, I did what I wrote and everything went well.

oidualc
  • 1,453
-1

Here is a simple way to dual-boot Windows with Ubuntu:

First of all, back up ALL of your data on to another Hard Drive. Standard HDDs are very cheap these days so that shouldn't be a problem.

Next, put the installation CD into the disk drive and turn off your PC.

Now you are going to have to make sure that you have no external or internal drives plugged in except for your disk drive/installation USB and your hardrive that is currently running Ubuntu.

When you turn on your PC, quickly press delete or F2 depending on your motherboard to get to the BIOS settings. Every motherboard has different BIOS so you might need to refer to your user manual for this next step. You will need to boot from your installation media (CD or USB flashdrive) in my case, I simply have to go to boot selection and select "(UEFI) CD Drive" or rearrange the drives so that CD Drive is first and save the settings.

Your PC should be rebooted and you will boot into the CD. Now you will see the Windows 7 installation screen. Select the appropriate settings and then select custom installation. Now select your Hard Drive and click "format" this will remove everything on your drive (This means everything. Including Ubuntu and all of your data. assuming you actually backed it up.) now you will need to install. Windows.

When Windows finishes installing, you can now create your Ubuntu installation media and boot from that. When you boot it will ask you if you want to install or try Ubuntu. Select "Try Ubuntu" and click on the application on the desktop called "Install Ubuntu" Now select your appropriate settings (make sure you are connected to the internet!) select "Install this Third Party Software" and select "Install updates during installation" now click on next.

Now click on "Install Ubuntu alongside Windows Boot Manager" and wait for it to install.

When it finishes installing, restart your PC and go into BIOS settings. Now make sure that Ubuntu boots before Windows and save your settings.

When you restart your PC, it will ask you if you want to boot from Ubuntu or Windows. Use the up and down arrows to select one and press enter to boot. If it takes you more that 10 seconds to choose something, you will automatically boot into Ubuntu.

There you go. I hope it helped.