- Change the boot order
- Delete Ubuntu From The UEFI boot menu
- Remove Ubuntu Folder From EFI partition
- Delete the Ubuntu partition
- Expand Windows 10 into free space
Change The Boot Order
Boot into Ubuntu and open a terminal window (either press CTRL, ALT and T at the same time or press the super key and type term until an icon appears and click on it).
Within the terminal window type the following:
This will show you the current boot order and in theory Ubuntu will be first and Windows second.
My boot order has a few extra ones because I have been a little bit untidy and not deleted old entries. As you can see though it starts at 0004 which is ubuntu and then goes to 0001 which is Windows, 0000 which in theory is Fedora, 0008 which is CentOS, 0005 which is another ubuntu, 0006 which is yet another ubuntu, finally finishing with 2001 which is a USB drive.
Now I don't really have loads of Ubuntus, Fedora and CentOS installed. These are old entries. The important bits are 0004 which really is Ubuntu and 0001 which is Windows.
What you need to do is make Windows the first item in the list again.
sudo efibootmgr -0 1
As you can see in my list 0001 is Windows. You can add extra entries if you so wish but this should suffice to make Windows first.
On its own this doesn't delete Ubuntu but it stops it from booting.
Delete Ubuntu From The UEFI MenuIn the previous section you will have noticed from the screenshots that I had a lot of old menu items hanging around.
To delete a menu option you specify the following command:
sudo efibootmgr -b 8 -BYou need to replace the 8 with the number of the menu item you wish to remove. If you look at the image above boot0008 is for CentOS Linux. After running the above command the CentOS has been removed.
The -b switch stands for modify boot number and the -B stands for delete bootnum.
You can specify the same command in the following way:
sudo efibootmgr --bootnum 8 --delete-bootnum
Remove Ubuntu From The EFI PartitionIf you don't remove Ubuntu from the EFI partition then it may be added back to the UEFI boot menu when you add other Linux operating systems.
The steps required here are to work out which partition is the EFI partition, mount it, navigate to it and then delete the Ubuntu folder.
To find out which partition is the EFI partition type the following in a terminal window:
sudo fdisk -lThis lists all the partitions on all the disks attached to your computer.
As you can the EFI partition on my disk is /dev/sda1 as the type shows as EFI system.
I therefore need to mount the EFI partition. I can do this by running the following commands:
mkdir EFIWith the EFI partition mounted you can navigate to it using the following command:
sudo mount /dev/sda1 EFI
cd EFIWhen I ran the ls command against the EFI partition there was a folder called EFI. So I navigated to the EFI folder using the cd EFI command again and ran the ls command once more.
As you can see I have folders for the following distributions:
To remove each of the folders all I have to do is use the rm command as follows:
sudo rm -R Apricity
Delete The Ubuntu PartitionBoot back into Windows 10 and then right click on the start menu
Click on the "Disk Management" option in the menu.
As you can see I have highlighted the partition on my computer that currently still has Ubuntu installed on it.
Make sure you choose the correct partition otherwise you may delete something important.
Right click on the partition and choose "Delete Volume".
A message will appear asking whether you are sure you want to delete the selected partition. Click "Yes".