1

I am trying to uninstall Ubuntu on a Windows 10 dual boot. I understand that I must delete the partitions holding Linux and the Linux swap, but do not know how to proceed to get rid of boot entry and GRUB.

I have read that I can use efibootmgr on a live version of Ubuntu to delete the Ubuntu entry, but I have also read that I can delete the Ubuntu folder in the EFI directory through Windows. Are these two methods the same or do I have to use both of them to completely erase traces of Ubuntu?

Thank you for your help.

mook765
  • 15,925
coolro
  • 31

2 Answers2

0

First boot to Ubuntu and install efibootmgr and use it to check your current efi boot list.

$ sudo apt-get install efibootmgr
$ sudo efibootmgr
BootCurrent: 0000
Timeout: 10 seconds
BootOrder: 0000,0004,2001,2002,2003
Boot0000* ubuntu
Boot0003* Windows Boot Manager
Boot0004* Windows Boot Manager
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network

In my example, my windows boot manager is entry 4, and ubuntu is entry 0. You can see the boot order 0, 4, ...

To delete the Ubuntu boot entry, first update the boot order then delete the Ubuntu entry (follow the number on your computer, not this example.)

$ sudo efibootmgr -o 4,2001,2002,2003
$ sudo efibootmgr -B 0

Now you can go ahead and boot into Windows and use the disk manager to remove the Ubuntu partition.

PS: Make sure you keep everything in the list except the Ubuntu entry you want to remove from the boot list.

Additional info can be found in the UEFI Wiki page. It explain that EFI system partition is mounted on /boot/efi, and other useful details.

Bernard Wei
  • 2,125
  • So will that remove the Ubuntu folder in the EFI directory in the “system” partition? I noticed that was what was done using the windows command prompt method. Also, is it safe for me to delete the Linux swap petition as well? – coolro Jul 27 '18 at 18:04
  • After you have deleted the ubuntu entry from the efi boot list, it is safe to remove all partitions created by Ubuntu, the root and swap paritions. – Bernard Wei Jul 27 '18 at 18:06
  • Ok thank you, but I still would like to know if deleting the Ubuntu entry will actually be deleting its directory in EFI data, or if it is only just erasing it from the list in the bios boot menu. – coolro Jul 27 '18 at 18:09
  • It should remove the entry from the efi partition. If not, you can go to /boot/efi/EFI and delete the Ubuntu directory. – Bernard Wei Jul 27 '18 at 18:12
  • Must I boot from a live version of Ubuntu to use efibootmgr or can I use the Ubuntu installed on my computer? I wanted to make sure deleting the entry from which I boot from would not affect the operation. – coolro Jul 27 '18 at 19:19
  • The ubuntu-folder in the ESP is not deleted this way and the boot entry will likely be recreated. – mook765 Jul 27 '18 at 19:28
  • @coolro you can do it with your current Ubuntu session, no need to boot from live usb/cd. Just be very careful not to remove your windows setup and the rest of the items in the boot order list. – Bernard Wei Jul 27 '18 at 19:53
  • @mook765, would I be able to delete the entry using efibootmgr, then delete the ubuntu folder in windows? I don't know how to mount partitions in linux, so I'm wondering if I can reboot back into windows to do this without having the entry being recreated. – coolro Jul 27 '18 at 20:19
  • @coolro The efi folder I described should be already mounted, do a "cd /boot/efi/EFI" but you need super user access to see it, so you need to do a "sudo -s" first. – Bernard Wei Jul 27 '18 at 21:03
  • But the directory in /boot/efi/EFI is not necessarily within the ESP partition, correct? – coolro Jul 27 '18 at 21:53
  • @coolro Ubuntu reuse the same ESP create by Windows instead of creating additional one. Beside ubuntu, you will find windows configuration there are well. Don't delete the ESP. If you must, only remove the ubuntu folder. I would leave the ESP partition alone but if you insist of delete all traces of ubuntu from it, you may remove the ubuntu folder on that if anything is left behind by efibootmgr. – Bernard Wei Jul 27 '18 at 23:22
  • @coolro Added Ubuntu UEFI wiki page to my answer so you can read up some of the details. It explains a lot of details better than me if you want to learn more. – Bernard Wei Jul 27 '18 at 23:30
  • Alright, thanks for all your help Bernard! I really appreciate it – coolro Jul 28 '18 at 00:02
0

the best way to completely remove ubuntu is using a windows live DVD to delete the ubuntu partition then extend the current windows to the whole drive .

just reboot your computer with a bootable windows DVD, and fallow the instructions to get ride of ubuntu.

Kaylee
  • 63