2

I am just about to install Ubuntu alongside Windows, just need to make sure I know how to remove it later.

I know from past the major problem was when I removed Ubuntu, I either still got into the GRUB booting menu, or I couldn't boot at all, and had to format HDD and start over. Now I found an article practically saying the Windows loader should be back upon deleting Linux partition, so I want to make sure:

If I have Windows and Ubuntu dualboot, and I want to get back to Windows booting quickly itself without choosing from any booting menu, is it enough to just delete the Ubuntu partition? Will the Windows loader override GRUB?

Thanks!

2
4

This depends on whether your operating systems are installed in UEFI mode or Legacy mode.
(If your PC is manufactured in the last 5-6 years, and came pre-installed with an operating system, it will most likely be UEFI.)
There is a similar question that you can follow to check whether you are using Legacy or UEFI.

Note: Irrespective of which mode you install in, if you simply delete the Ubuntu partition, it won't make the Windows bootloader default automatically. You have to do it once, manually.

If you install in Legacy mode and then delete the Ubuntu partition

You'll most likely end up in a grub rescue prompt on the next boot. You'll need a bootable recovery disk (either Windows or Linux) to help you restore your Windows boot sector.
Here is a similar question that can help in this case.

If you install in UEFI mode and then delete the Ubuntu partition

You'll most likely end up in a GRUB command line prompt on the next boot, from where you'll have to boot to Windows and delete the GRUB EFI Firmware entry or change the order to put the Windows bootloader in the first place.
Here is a similar question that can help in this case.

So, what's the better way?

For Legacy

Boot to Windows first and use the bootsect tool to replace the GRUB boot sector with the Windows boot sector, and then delete the Ubuntu partition. Run these from an elevated Command Prompt :-

bootsect /nt60 SYS /mbr
bootsect /nt60 SYS

For UEFI

Manually delete the GRUB EFI boot entry and/or set the Windows bootloader to the first position before you get rid of Ubuntu.
This answer to a similar question explains the process for deleting it in Windows.

To perform this from Ubuntu, the efibootmgr tool can be useful. Run :-

sudo efibootmgr -v

to see the entries currently in your bootloader, then run :-

sudo efibootmgr -b XXX -B

to delete entry XXX.

1
  • Excellent, thank you very much!
    – Imro
    May 18 '20 at 15:13
0

If you face any such problem read this post: Unable to boot into windows after removing Ubuntu 20.04

boot from your Ubuntu live CD/ USB and follow instructions given in link of Boot-Repair page. Follow the second option:

install Boot-Repair in Ubuntu

  • connect to the Internet
  • open a new Terminal, then type the following commands (press Enter after each line):
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

And follow Recommended repair for more detail.

You can also refer to website of Boot-Repair

2
  • Thank you! There comes another story though, I'm kind of unable to use "try ubuntu" via my bootable USB stick. I think I will be able to install it, but whenever I press Try ubuntu, the computer freezes. Would installing these repositories BEFORE removing Ubuntu do the trick as well? Thank you!
    – Imro
    May 18 '20 at 14:53
  • No, Boot-repair only works at real time state.
    – Ajay
    May 18 '20 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.