Some of you may have read my article on how to Dual Boot Windows 8.x and Ubuntu 14.x … which works great, but what if you want to undo this; remove Ubuntu Dual Boot and remove the boot manager?
For example when you’ve decided that running Ubuntu from a USB stick is sufficient, or maybe run Ubuntu in a virtual machine with VMWare, Parallels, or VirtualBox. Or maybe you’re selling your computer and the new owner has no desire to have a Dual Boot on their “new” PC?
In this article I’ll show you how to remove the Dual Boot. I’m doing this based on the way I have installed Dual Boot, but it will very likely work for installations that have not followed my article. No additional tools are needed, like special applications, a repair or recovery CD or a live USB stick.
Do keep in mind though that this article is based on a computer that has a UEFI “BIOS” and not an old regular BIOS.
Remove Dual boot Windows and Ubuntu
The idea of this article is that you have a computer setup with Dual Boot Windows (7, 8, 10) and Ubuntu (or another Linux distro), where your computer has an UEFI “BIOS“, as you might have done based on our article “how to Dual Boot Windows 8.x and Ubuntu 14.x“.
We assume a DUAL boot of Windows and Ubuntu! So only 2 Operating Systems!
For all options that I found out there, one would have to execute these basic steps:
- Remove Linux boot loader, in other words: remove Grub.
- Remove Linux partition(s) and optionally expand your Windows partition.
- Restore the Windows boot.
The short version for the impatient …
And believe me, I count myself as one of the “impatient” … but I do recommend reading the details …
The short version is:
- determine which partition(s) are Linux related,
- in Linux remove the “ubuntu” directory from “/boot/efi/EFI”,
- reboot into Windows,
- remove the Linux partitions, and
- resize your Windows partition if so desired.
Alternative method with one single tool …
If you don’t like the method I’m using, then please consider a Linux tool called OS-Uninstaller – it does all these steps for you within a few clicks.
- Boot your computer on a Ubuntu DVD or live-USB and choose “Try Ubuntu”
- Open a new Terminal (Ctrl+Alt+T), then type:
sudo add-apt-repository ppa:yannubuntu/boot-repair
- After that type:
sudo apt-get update; sudo apt-get install -y os-uninstaller && os-uninstaller
- Follow the on-screen instructions.
So we should probably first understand what we are looking at:
A Windows partition (which we’d like to keep), a Linux partition (the one we’d like to remove), a bunch of other partitions of which we might have no clue why Microsoft even put them there (depends on your Windows version and hardware manufacturer), and GRUB.
All those Partitions …
The partitions are probably obvious if you’re playing with your computer at this level.
However, if you’ve looked at the partitions on your computer (especially with Windows 8 and up), you’ll see a boat load of partitions. This can lead to confusion and mistakes …
So the trick is to find which one is your Linux partition – to avoid that we damage vital partitions.
Tools we need: None
I have seen many articles write about the use of extra tools, and frankly, I’m just too lazy to create a Windows Repair or Recovery disk, and I didn’t feel like creating an Ubuntu Live CD/Stick either. Installing additional tools wasn’t what I wanted either. I really wanted to fix this with the tools already on my computer.
So we will only use what is already available …
For additional information on other methods, please see the list of links below.
I assume that you’re looking at a dual boot PC, which boots into either Windows or Ubuntu (possibly another Linux distro), where the PC has an EFI or UEFI BIOS.
Systems with more than 2 Operating Systems should keep in mind that this method might prevent access to the other operating systems!
Mac users should also not proceed with these steps, as I have no clue if it would work the same way.
Step 1 – Determine your Linux partition(s)
This is one of the step where you really have to pay attention – we would not want to destroy partitions that we still need.
For this step, simply boot into your Linux (Ubuntu) where we will use the command line statement “lsblk” (spelled in capitals: LSBLK).
Open a terminal window, type “lsblk” (without the quotes) and press the ENTER key. You should see something like this:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 400M 0 part
├─sda2 8:2 0 300M 0 part /boot/efi
├─sda3 8:3 0 128M 0 part
├─sda4 8:4 0 817.6G 0 part
├─sda5 8:5 0 450M 0 part
├─sda6 8:6 0 15G 0 part
├─sda7 8:7 0 82.8G 0 part /
└─sda8 8:8 0 14.9G 0 part [SWAP]
Note : Under normal circumstances, you would not need to use “sudo”. If however you get an error, try
sudo lsblk . It will ask for your admin password though.
Note : If your Linux distro does not come with “lsblk” then please look at this article to see how it’s installed. Typically this is done with
sudo yum install util-linux-ng or
sudo apt-get install util-linux -y .
Let’s take a closer look at what is being presented here:
- My computer has only one disk in it which is
/dev/sda (see line 3).
- The disk has 8 (!) partitions … OMG … wouldn’t 2 or 3 have been enough?
- The partition sda2 is the UEFI partition (see line 5),
- The partition sda7 is mounted as our Linux root (see the “/” symbol at the end of line 10?).
- The partition sda7 is 82.8Gb.
- The partition sda8 is our Linux swap partition ([SWAP] is a pretty clear indicator in line 11).
- The partition sda8 is 14.9 Gb.
This is the info we really need.
The other partitions can be pretty much anything, let’s not touch thouse …
So for this article I will need to remove sda7 and sda8.
Take note of their sizes, as this will become useful in step 3.
On your system these will likely be different – so pay good attention and use the partitions and sizes you’ve found for your system!
It can be that your system does not have the swap partition, so that case you’d only have to remember the root partition.
Step 2 – Modify UEFI, while we still have Linux access
Since we are still in Linux, I’d consider this a good time to modify the UEFI files on the UEFI partition.
It has since brought to my attention that you should use “efibootmgr” to remove the Linux (grub) entries one by one.
The method I used however, worked perfectly fine on my setup.
UEFI maintains which Operating Systems it can boot from in it’s EFI partition. In step 1, we did see this to be mounted as
When you look in that directory, you’ll see something interesting:
$ cd /boot/efi
$ ls -l
drwxr-xr-x 0 root root 4096 Aug 31 07:43 boot-sav
-r-xr-xr-x 1 root root 512 Apr 18 2014 BOOTSECT.BAK
drwxr-xr-x 6 root root 4096 Jul 15 2014 EFI
-rwxr-xr-x 1 root root 880640 Dec 31 1979 FSCK0000.REC
-rwxr-xr-x 1 root root 4096 Dec 31 1979 FSCK0001.REC
-rwxr-xr-x 1 root root 4096 Dec 31 1979 FSCK0002.REC
-rwxr-xr-x 1 root root 4096 Dec 31 1979 FSCK0003.REC
-rwxr-xr-x 1 root root 4096 Dec 31 1979 FSCK0004.REC
-rwxr-xr-x 1 root root 4096 Dec 31 1979 FSCK0005.REC
-rwxr-xr-x 1 root root 4096 Dec 31 1979 FSCK0006.REC
$ ls -l EFI
drwxr-xr-x 2 root root 4096 Aug 22 2013 Boot
drwxr-xr-x 3 root root 4096 Aug 22 2013 Microsoft
drwxr-xr-x 3 root root 4096 Feb 22 2014 OEM
drwxr-xr-x 2 root root 4096 Jul 15 2014 ubuntu
Here you see the directories that EFI maintains on it’s own tiny partition. Do you see “Microsoft” and “ubuntu”? I’m sure you can guess where this is going … we need to remove the “ubuntu” directory … (other Linux distro’s might use a different name!)
If you look in the Ubuntu directory then you’ll see an old friend as well: GRUB …
Anyhow … we will remove the Ubuntu directory by going to the EFI directory and removing the directory as follows:
$ cd /boot/efi/EFI/
$ sudo rm -rf ubuntu
Now that you have removed the Ubuntu “entry”, time to reboot. Your PC will now boot straight into Windows!
N.b. : Depending on your system, it might show a “Updating your System” message and possibly reboot.
Step 3 – Reclaim Disk Space in Windows
So now that your computer is booting in Windows again, time to reclaim the space Linux used.
Note : You can only merge the disk space of your Linux partition(s) with the partition right before or right after the unallocated space. If you happen to have a D: drive between the C: drive and the unallocated space, then you can only merge with the D: drive.
Note : If you had your Linux partition in an extended partition, then you still need to remove the primary partition that held that extended partition as well. See this SevenForums post for more information.
In this step we will use “Disk Management”, which can be started in several ways.
- By far the fastest way is from “Run” dialog ( + R) or Command Line, where you type: diskmgmt.msc
- Or … right click on “My Computer” (or “This PC”), select “Manage” and go to “Storage” “Disk Management“
There are several other ways to get there, these 2 just seemed the most obvious for me personally.
First we need to locate our old Linux partitions. You can identify them based on a few facts:
- Partition Size (remember those from Step 1?),
- Often a “Primary Partition”,
- Often no drive letter (ie. like “C:” for your Windows partition),
- Often no file system format is mentioned (like “NTFS” for your Windows partition).
Disk Management – Locate your old Linux partitions
Right click the old Linux partition and select “Delete Volume…“.
If you had more than one Linux partition, then please repeat for the other one(s) as well – this would typically be the swap partition.
Do yourself a favor and triple check you’re picking the right partition. There is no undoing this …
Disk Management – Right click partition and select “Delete Volume”
Disk Management will ask for confirmation, just to make sure your eally want to do this … click “Yes”.
Disk Management – Are you sure?
After deleting your old Linux partition(s), you should see an “Unallocated” block, which indicates unallocated disk space.
Disk Management – Unallocated disk space
Having unused disk space on your drive is a waste, so if you’d like add it to your Windows partition.
To do this, right click the Windows partition (typically drive “C:”).
Disk Management – Right click your Windows Volume
From the upcoming menu, choose “Extend Volume…” …
Disk Management – Select “Extend Volume”
A wizard will start, click “Next”.
Disk Management – Extend Volume Wizard
It’s completely up to you what you’d like to d here.
To maximize your Windows partition, the value for “Select the amount of space in MB” should match “Maximum avaialble space in MB” – which it by default does. Click “Next” when you’ve made up your mind.
Disk Management – Maximize Volume
The wizard will show an overview of the action you’ve selected, click “Finish” to complete this task.
Disk Management – Review Actions
The extending of a partition goes pretty fast and within seconds you should see your newly extended Windows partition.
Disk Management – Newly resized Windows Volume
I did some research before writing this article – only to find out that all methods mentioned are unneeded complicated and all seem to require additional tools.
For those interested, here a list of a few articles and forum posts that I have read.
Note that none of these use the approach I have used here, but these article might be practical for those not running an UEFI BIOS, or just for those who are curious and want to do their homework first.