Вы находитесь на странице: 1из 23

 

Operating Systems Networking System Administration Information Technology Development

HO ME PAG E  O P E RATING SYSTE MS

Install Windows after Ubuntu


Linux in Dual Boot Mode
In this article we will see how to install Windows in dual boot mode on a computer on
which Ubuntu is already installed. We will install Windows over Ubuntu. Then repair
GRUB boot loader to access Windows as well as Ubuntu in dual boot mode. It is a
common practice to install multiple operating system on a computer. Generally, users
install Windows and Linux Operating Systems in dual boot mode on their computers.
In this article we are taking Ubuntu flavor of Linux Operating System. Each of these
Operating Systems will act as a Host Machine. The system can load one of the
operating system at a time. That means you can either load Windows or Ubuntu Linux
at a time. We will install each of the operating system on a different disk partition.
Generally, a user installs Windows first and then installs Ubuntu Linux after Windows.
On successful installation, the user gets an option to choose one of the dual boot
operating systems. User may choose either Windows or Linux from the boot menu to
load the operating system. The user can also switch between Linux and Windows as
per his requirement. He can restart the operating system he is using, select another
operating system from boot menu and load it.

Normally, when a user installs Ubuntu Linux over Windows, things go fine. Whereas, if
the user installs Windows over existing Ubuntu Linux, there are two problems:

The Ubuntu Linux is lost ! The boot loader menu is also lost !

The system is only left with Windows without any trace of Ubuntu. So, what to do if you
want to install Windows over existing Ubuntu Linux? Or is it that we have to always go
the other way around only? The answer is No. You can go either way. That means, either
you can install Ubuntu first or you may install Windows first.

But what goes wrong when we install Ubuntu first and then Windows? The answer is
that Windows Boot Loader overwrites the Linux boot loader. Since, the option to load
Linux is lost in absence of Linux boot loader. Thus, the user is not able to load Ubuntu.
So, we need to perform an extra step. The step is to repair Linux (GRUB) boot loader
after installing Windows over Ubuntu Linux.
Let us see how to install Windows over Ubuntu in dual boot mode using boot repair in
following simple steps:

Note : Ensure that you have backup your data saved on your system with existing
Ubuntu Linux as it may be lost in case some error occurs during installation process.

Step 1: Free up some space from your hard disk for


installing Windows after Ubuntu
It is possible that you may have single or multiple partitions on your computer. If you
have a single partition then follow option ‘b’ below. Else, if you have multiple partitions
then follow option ‘a’ below:

Option ‘a’ (Multiple Partitions):


If you have multiple partitions, let’s say you have two partitions. Then Partition 1 will
contain Ubuntu Operating System and Partition 2 may contain some other user data.
You can see the same in image below as an illustration:
You can shrink the partition containing data to free up space for Windows. But you
cannot resize the partition containing Ubuntu system files. To resize second partition,
open “Disks” application from Ubuntu application menu as shown in below image:

Follow below mentioned steps to resize the partition on which Ubuntu is not installed:

A. Select Partition 2

B. Unmount partition 2

C. Click settings icon

D. Select Resize option

E. Drag resize slider to free up appropriate space

F. Click ‘Resize’ button


The above steps are shown in below image as an illustration:

As a result of above steps, free space will appear after Partition 2 as shown below in
green box:
Close the ‘Disks’ application on successful resizing and un-allocation of disk space for
Windows OS.

Watch above process in Video: How to resize secondary partition and un-allocate
space in Ubuntu

Option ‘b’ (Single Partition):


The method mentioned above will not work if your system has single partition. In case
of single partition, the Ubuntu system files will exist on this single partition. While you
are operating Ubuntu, the system files will be in use. Thus, the Disk volume will be busy.
A busy disk volume cannot be unmounted. The system cannot resize a mounted or
busy disk.

Thus, we need some external factor to boot from and resize the single partition on
which Ubuntu Operating System exists. For the purpose, we will boot the computer from
bootable Ubuntu Flash Drive and use ‘GParted’ utility.

If required, check out one of the following ways on how to create a bootable Ubuntu
Flash Drive:
as e:

1. On existing Ubuntu system using Startup Disk Creator


2. On Windows system:

using Balena Etcher Flashing Software


using Rufus Software

Boot from Ubuntu Flash Drive:

Once you are ready with bootable Ubuntu Flash Drive, insert it in the computer and
restart the system. While the system is rebooting press F10 (or Del or F9 or F12 or Esc)
to enter BIOS Setup. You may try other keys as per Make and Model of your machine to
enter BIOS setup. Select USB Storage Boot as Booting Device from boot options. Save
and Exit. The system will reboot again. While the system is rebooting press F9 (or Del or
F10 or F12 or Esc) to display Boot Menu. You may try other keys as per Make and
Model of your machine to display boot menu.

Select Flash Drive as Boot Device from the Boot Menu List and Hit Enter. Ubuntu setup
will load from the Flash Drive. Click on ‘Try Ubuntu’ option from Ubuntu setup as shown
in below image as an illustration:
Live Session of Ubuntu Linux will load from Flash Drive.

Run GParted application:

Open ‘GParted’ application in this live session from application menu. The GParted icon
will be as shown in below image:

GParted will detect and display the Hard Disk with its capacity and the existing partition
on it. Click on the partition to select it. Then, click on the ‘resize’ button as shown in
below image:
Click on the ‘Resize’ button. A dialog box will open with options for resizing partition.
You can resize the partition by entering either free space size or New size of partition in
Megabytes. Alternatively, you may also use the slider to change the size of the partition
as shown in below image:

Drag the slider to shrink the partition and free space as un-allocated space as per your
requirement. Satisfy yourself with new size of partition and new un-allocated space
freed from the partition. Then click on ‘Resize/ Move’ button as shown in below image:
The un-allocated space will be shown in grey color. We will use this un-allocated space
to install Windows 10 on it. Click on ‘Apply’ button to save the resizing changes. The un-
allocated space and ‘Apply’ button are highlighted in below image:

Click on ‘Apply’ to save the changes in the popped-up dialog box to save the resized
Click on Apply to save the changes in the popped up dialog box to save the resized
configuration of the partition. Wait till all resizing operations are successfully
completed. Then close the Gparted Application. Reboot the system. Remove Ubuntu
Flash Drive from the Computer when Ubuntu live session prompts for it before system
reboot.

Reboot computer to check disk changes:

The system will then boot from computer hard disk and load existing Ubuntu Linux
system. You may login to Ubuntu system and check disk partitions. The above must
have shrink the Linux partition. Also, it must have create an un-allocated space. The
same is shown in below image in green box as an illustration:

Watch above process in Video: How to resize primary partition and un-allocate space in
Ubuntu

The First step should be successful by now. You will be ready with an un-allocated
space on your hard disk. We will use this space to install Windows 10 on it as a dual
boot host system.
Step 2: Install Windows after Ubuntu on free un-allocated
space
Boot from Windows Flash Drive:

Insert Windows bootable Flash Drive. Restart the system. Boot the system from
Windows Flash Drive. Press F9 (or Del or F10 or F12 or Esc) to display Boot Menu.
Select Flash Drive as Boot Device from the Boot Menu list and Hit Enter.

Note: Check out methods to create windows bootable Flash Drive on existing Windows.
You may also check how to create windows bootable Flash Drive on existing Ubuntu
Linux.

Windows 10 installation setup will Load from Flash Drive. On the Windows installer
welcome screen select basic information such as Language, Time, Currency Format
and Keyboard or Input Method. If you do not have any particular choice, proceed with
default values and click on ‘next’ to continue.

Click on ‘Install Now’ button to begin installation process. The installation process will
prompt to Activate the copy of Windows operating system.

It may be noted that Windows is not a Free Operating System. You will need to purchase
a License to use it. The license can be purchased and activated later with Product Key
provided during purchase. As of now, click on ‘I don’t have a product key’ to continue
windows installation.

Select the Edition of Windows you wish to use, ‘Windows 10 Pro’ is best suited for
professionals. Accept the License terms and click on ‘Next’ to continue. Accept the
Windows license by clicking the check box with label ‘I accept the license terms’. Then
click on ‘next’ to continue.

Windows installer will inquire you about the type of installation you want? Since this will
be a fresh installation, select ‘Custom Installation’ instead of ‘Upgrade’ from the
i t ll ti t ti
installation type options.

Now, the most crucial step. Windows installer will ask you, where to install Windows?

Select Partition to install Windows:

As you can see in below image, the first partition i.e. Partition 1 on Drive 0 is primary
partition with Ubuntu installed on it. Also, an un-allocated space (of 500 GB in this
example) is available for use.

Select the un-allocated space and click ‘New’ to create a New Partition from this un-
allocated Space for Windows installation. When prompted, click on ‘Apply’ and then ‘OK’
to create a new partition. Windows setup will create a system partition (approximately
~500 MB) and a user partition (Balance Space). The same is shown in below image:
Select the newly created Partition other than system partition and click on ‘Next’ to
proceed for installation. The installation process will start. Wait till Windows setup files
are copied and copied setup files gets ready for installation. The installer will install
Windows features from setup files. If your system is connected to internet Windows
may install Updates as well. Wait till installation process is complete.

Note: The Computer may automatically restart few times during the installation
process. Keep the Flash Drive inserted in the computer. Do not press any key during
system restart. Doing so may boot the system from Flash Drive again and fresh
installation will start.

Configure Windows after installation:

After installation, the setup will continue to start services and ready the devices. The
system may restart multiple times during configuration. When setup prompts, select
your region, select the keyboard layout and add secondary keyboard layout. Else
proceed with default options if there is no particular requirement. You may setup
Windows for personal use and may add organizational details at a later stage, if
required. If you have a Microsoft account ID you can provide it. Else proceed with offline
account and create online account later. You may select one of the Microsoft group’s
account for login. Else, click ‘No’ if no Microsoft Group’s account is available, you can
add such accounts later.

Type your Name and click ‘Next’ to continue. Create a strong password followed by
yp y gp y
secret questions. Click on ‘Accept’ to designate Cortana as your Digital Assistant while
you use Windows Operating System. Choose Privacy settings, else proceed with default
options, if no particular choice.

Your Windows 10 Operating System will be ready for Use. Open File explorer to check
disk partition. You will see C: Partition with available capacity. Also, open Disk
Management in Computer Management to check Disk Partitions. All disk partitions will
be visible here. But Linux system partition will not be visible in Windows File Explorer.
Close Computer Management. Restart Windows. You will notice that Windows OS has
loaded without showing any option to switch between Ubuntu and Windows. This
happens because Windows Boot Loader overwrites existing Linux Boot Loader. Let’s
follow step 3 to repair the GRUB boot loader and restore Ubuntu operating system.

Step 3: Repair Ubuntu Grub Boot Loader


Re-insert Ubuntu Flash Drive and restart windows. Boot from Ubuntu Flash Drive by
selecting option from boot menu. Press F9 (or Del or F10 or F12 or Esc) to display Boot
Menu. You may try other keys as well as per make and model of your computer. Ubuntu
setup will load from flash drive. Click ‘Try Ubuntu’. Ubuntu Live Session will load from
Flash Drive. Open Terminal in Live session of Ubuntu.

Add repository of ‘Boot-Repair’ application and update package database by typing the
following commands in terminal:

sudo add-apt-repository
ppa:yannubuntu/boot-repair

sudo apt update


Aft d ti th k d t b t f ll i dt i t ll ‘B tR i’
After updating the package database, type following command to install ‘Boot-Repair’
application:

sudo apt install boot-repair


Enter root password and press ‘Y’ or ‘Enter’ key when prompted. After installing ‘Boot-
Repair’ application, run ‘Boot-Repair’ application by typing following command:

boot-repair
The boot repair application will open from terminal prompt. Click on ‘Recommended
repair’ button as shown in below image:

Wait for the boot repairing process to complete. You may click on ‘No’ when prompted
to upload the boot-info to paste bin. If there is some error during the process. You may
click ‘yes’ to save and share the error messages occurred during the process. Boot
Repair application will display Boot Info Summary after successful repairing of GRUB
boot loader. Close the summary report and exit Boot-Repair application.

Reboot your computer:

Remove Ubuntu Flash Drive from the computer when prompted and hit ‘Enter’. Wait for
the system to restart. Upon restart, the system will display the Boot Loader to choose
between Ubuntu and Windows operating system. The same is shown in below image as
an illustration:

As shown in above image, first option is for loading Ubuntu whereas last two options
are for Windows. Select first option and hit ‘Enter’ to load Ubuntu Operating System.
Existing Ubuntu Operating System will successfully load from the hard disk. Reboot the
system. The GRUB boot loader will load again. Select one of the options as shown in
image above to load Windows operating system.

Watch the practical demonstration of the above the above process in below video:

Install Windows over existing Ubuntu Linux in Dual Boot mode using boot rep…
rep…
g g p

Note: The above video also shows how to share files between your Windows and
Ubuntu system existing in dual boot mode on a computer.

We hope the above information was useful for you. Alas! Information keeps on
updating. Follow us on social media, subscribe to our blog or subscribe our YouTube
Channel to receive latest updates.

         

VIEW COMMENTS

Thiga
15th November 2020 at 3:57 am

Worked perfectly from beginning to end! Thank you so much for writing this. I made the mistake of only having
one flash drive nearby so creating the bootable media three times was a pain lol.
Keep up the good work!

TechSolvePrac
15th November 2020 at 7:26 am
Thanks for the appreciation 🙂
Amine
20th October 2020 at 10:25 pm

Hi, so i need both windows and ubuntu on bootable usbs ? will i keep my ubuntu files ? thanks

TechSolvePrac
21st October 2020 at 7:16 am

Yes, you will need bootable USBs of both Unbuntu and Windows. If you have 2 USBs then you can make
both bootable or you may use the same USB alternately. Data on usb will be lost. Data in existing Ubuntu will
be preserved. However, it is always advisable to take back of your important files before proceeding
because there is a chance of lossing data in case of some interruption during installation process.

Mint
19th October 2020 at 3:49 pm

Hi! Can I somehow make Win10 the fist or default option? I use W10 mostly and I hate this loared expiring time
and need to reboot. Please help!

Intrested Panda
16th October 2020 at 1:48 pm

One of the most detailed and awesome blog regarding this probelm. Thanks 😉
TechSolvePrac
16th October 2020 at 1:49 pm

Thanks for the appreciation 😊


Wojtek
5th October 2020 at 7:33 pm

Maybe there should be a warning in “Boot from Windows Flash Drive” to use UEFI boot mode, I was stuck, getting
an error about being unable to install on the GPT drive.

Andy
24th September 2020 at 6:15 am

How much free space should be allocated for the new partition? I am confused on this matter. I am planning to
use Windows 10 for Adobe photoshop/illustrator/prelude and other windows-only software, whereas my Linux
distro is currently being used for deep learning. I have one 2TB SSD. Will partitioning 1TB take away from either
of the two OS uses?
TechSolvePrac
24th September 2020 at 7:29 am

1 TB per OS is absolutely fine.

Jonathan Francoeur
17th September 2020 at 12:26 am

I think that this:” If you have a single partition then follow option ‘a’ below. Else if you have multiple partitions
then follow option ‘b’ below”
Should read this:”It is possible that you may have single or multiple partition on your computer. If you have a
single partition then follow option ‘b’ below. Else if you have multiple partitions then follow option ‘a’ below

TechSolvePrac
17th September 2020 at 4:15 am

Ok. Will recheck and update shortly.

Wenjun
7th September 2020 at 8:50 pm

after I follow every step, I got this error: “we couldn’t create a new partition or locate an existing one” when I want
to install windows to drive 0 partition

TechSolvePrac
7th September 2020 at 9:53 pm

Did you created empty space by deleting existing partition?

Wenjun
7th September 2020 at 10:25 pm

Hi, thanks for your prompt reply, what do you mean that create empty space and delete existing
partition? I resize the partition following by option ‘b’, and then select the un-allocated space and click
‘New’ to create a New Partition from this un-allocated Space, then I got the above error

TechSolvePrac
8th September 2020 at 3:22 am

Whats the size of space you freed up after resizing your Linux partition?

Ryan
21st October 2020 at 7:32 am

Hi TechSolvePrac
Hi TechSolvePrac,
I am also receiving this same error as stated above. I have 150Gb reserved as unallocated
space at the rightmost end of my drive for the windows installation. Do you have any idea
what could be causing this?
Thank you for this blog post!

TechSolvePrac
21st October 2020 at 7:53 am

Press Shift + F10. Type "diskpart" command. Then, "list disk". Then, "select disk [disk number
of free space]". Then "clean". This should solve your problem.

Ryan
21st October 2020 at 2:30 am

Hi, thanks for the prompt reply! I don’t want to clear the entire disk since it also contains my
ubuntu installation. Will ‘clean’ remove everything from the disk?

Santosh
31st August 2020 at 8:22 pm

Here is the error I am getting while installing the windows after following every step carefully.. “Windows cant be
installed on drive 0 partition 3. The selected disk has an MBR partition table. On EFI systems, windows can only
be installed to GPT disks.”

Jonathan
18th September 2020 at 12:39 am

Me too.

TechSolvePrac
18th September 2020 at 6:38 am

I will suggest not to create a partition before installing windows. Just free up space by deleting
partition. During installation select this unallocated free space, then windows will automatically create
a small partition for placing boot files on MBR, rest space it will use for installing windows.

Herllon Cardoso
26th August 2020 at 6:58 am

Excellent post.
Will do it soon.

Leave a Comment
RELATED POST

Manjaro Linux Flash Drive using Balena Etcher

Recover your Data when Windows Password is


lost?

SUBSCRIBE TO BLOG VIA EMAIL

OTHER INFO

Content Policy

Home

About

Contact Us

Privacy Policy

Blog
Home About Privacy Policy Contact Us Blog Forum Books Numerical Aptitude

Content Policy

The content on this website is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. View
Non-AMP Version

Вам также может понравиться