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.
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
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.
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.
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.