Install windows after installing Ubuntu.


PROBLEM:

Installing Ubuntu after installing Windows is easy. But installing Windows after installing Ubuntu removes my grub installation. How can we safely install windows after installing Ubuntu.

SOLUTION:

Here's what we should do:

  1. Make space for windows.
  2. Install windows.
  3. Reinstall GRUB.
  4. Install the boot loader

MAKING SPACE FOR WINDOWS:

              Open Gparted and make a partition for windows according to your requirements. Make note of current /boot device. If that doesn't show up there, make note of the / device. The device name is something like sda5.
You can install Gparted using the following commands:

sudo apt-get install gparted



 OR you can use Gparted in your live Ubuntu CD.

INSTALL WINDOWS:


Just install windows into the space (partition) that you've made in the previous step.

REINSTALL GRUB:

Now load your Ubuntu live CD. Open a terminal in the live session and enter the following commands:

If you do not have a separate /boot partition:


sudo mount /dev/DEVICENAME_FROM_STEP_ONE /mnt
sudo rm -rf /boot
sudo ln -s /mnt/boot /boot


If you have a separate /boot partition:
sudo mount /dev/DEVICENAME_FROM_STEP_ONE /boot 




INSTALL THE BOOT LOADER:

Now type the following commands:


sudo apt-get update && sudo apt-get install grub-pc
sudo grub-install /dev/sda # NOTE THAT THERE IS NO DIGIT
sudo umount /boot


Now restart and you should be able to use both Ubuntu and Windows.

Popular posts from this blog

INSTALLING MOBILE PARTNER IN LINUX

How to setup a wifi-hotspot in Ubuntu: The terminal way.

Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?