How to Remove Ubuntu from a Windows Dual Boot

Short answer (UEFI, Windows 11/10)
  1. In the firmware setup (or with bcdedit), make Windows Boot Manager the first boot entry and confirm Windows boots.
  2. In an admin terminal: mountvol S: /S, then rd /s S:\EFI\ubuntu, then mountvol S: /D.
  3. In Disk Management, delete the Ubuntu partitions (no drive letter, usually ext4 and swap) and extend C: or create a new volume.

Do the steps in this order and you never see grub rescue>. Back up both systems first.

Before you start

  • Back up anything you need from Ubuntu. Once the partitions are deleted, the data is gone. Boot Ubuntu one last time and copy /home to an external drive; the rsync home backup script does this in one command.
  • Get your BitLocker recovery key if Windows uses device encryption (most Windows 11 laptops do). In an admin terminal: manage-bde -protectors -get C:, or find it at your Microsoft account's device page. Boot changes can trigger the recovery prompt once.
  • Have a Windows installation USB ready in case you need to repair the Windows bootloader.
  • Find out whether you boot UEFI or legacy BIOS. In Windows, press Win+R, run msinfo32, and look at BIOS Mode: UEFI or Legacy. Almost every PC from the last decade uses UEFI.
Ubuntu on a separate disk?

If Ubuntu is on its own drive, you can set Windows Boot Manager first in the firmware, delete the Ubuntu EFI folder (Step 2), and then wipe or reuse that disk. Nothing else needs to change.

Step 1: Make Windows Boot Manager the default

On a UEFI dual boot, the firmware starts Ubuntu's shimx64.efi, which loads GRUB, which offers Windows. Delete Ubuntu first and that chain breaks. So switch the firmware to start Windows directly first.

Option A: firmware setup

Reboot into the UEFI setup (usually F2, Del, F10 or F12 at power on; or in Windows: Settings → System → Recovery → Advanced startup → Troubleshoot → Advanced options → UEFI Firmware Settings). In the Boot section, move Windows Boot Manager to the top. Save and exit, and check that Windows starts without the GRUB menu.

Option B: from Windows with bcdedit

Open Terminal (Admin) or Command Prompt (Admin):

bcdedit /enum firmware

Example output (trimmed):

Firmware Boot Manager
---------------------
identifier              {fwbootmgr}
displayorder            {a1b2c3d4-...}
                        {bootmgr}

Firmware Application (101fffff)
-------------------------------
identifier              {a1b2c3d4-...}
description             ubuntu

Put Windows first, then remove the Ubuntu entry using the identifier shown on your system:

bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst
bcdedit /delete {a1b2c3d4-...}

Copy the identifier exactly, including the braces. Reboot and confirm Windows starts directly.

Step 2: Delete Ubuntu's files from the EFI partition

The EFI system partition (ESP) is a small FAT32 partition, often 100-500 MB, shared by Windows and Ubuntu. Ubuntu's boot files are in the EFI\ubuntu folder. Removing only that folder takes Ubuntu out of the firmware boot menu for good (some firmware re-creates entries for any bootloader it finds).

mountvol S: /S
dir S:\EFI
rd /s S:\EFI\ubuntu
mountvol S: /D

dir should show Boot, Microsoft and ubuntu. If you previously installed other Linux systems, you might also see fedora, debian or opensuse; delete those only if you are removing them too.

Never delete the EFI partition or EFI\Microsoft

The ESP and the EFI\Microsoft folder contain Windows' bootloader. Deleting them makes Windows unbootable. Also leave EFI\Boot alone: it is the firmware's fallback path. If EFI\Boot\bootx64.efi was replaced by Ubuntu's shim (rare), see Repair Windows boot.

Step 3: Delete the Ubuntu partitions

Open Disk Management: right-click Start → Disk Management. Ubuntu's partitions have no drive letter and Windows shows them as healthy partitions without a filesystem it knows. Identify them by size and position: typically one large partition (Ubuntu's root, ext4 or btrfs) and sometimes a swap partition or a separate /home.

PartitionHow Windows shows itDelete?
EFI System Partition100-500 MB, "EFI System Partition"No
Windows (C:)NTFS, drive letter C:, "Boot, Page File"No
Recovery500 MB-1 GB, "Recovery Partition"No
Ubuntu root / homeNo letter, no filesystem shown, size you gave UbuntuYes
Linux swapNo letter, a few GBYes

Right-click each Linux partition → Delete Volume. If the option is grey, use diskpart:

diskpart
list disk
select disk 0
list partition
rem check the size and type very carefully
select partition 5
delete partition override
exit
diskpart deletes without asking

delete partition override removes the selected partition immediately, including protected ones. Double-check the disk and partition numbers against Disk Management before running it. A wrong number destroys Windows or its recovery partition.

If you're not sure which partition is which, boot an Ubuntu live USB and run lsblk -f: it shows filesystem types (ext4, swap, ntfs, vfat) and labels clearly. GParted on the live USB can delete the Linux partitions too. More on reading partition layouts is in disk management.

Step 4: Reclaim the free space

Right-click C: → Extend Volume and follow the wizard. Windows can only extend into unallocated space directly to the right of C:. Common layouts:

  • C:, then free space: Extend Volume works directly.
  • C:, Recovery partition, then free space: Extend is greyed out. Either create a new volume (D:) in the free space, or move the recovery partition. Microsoft documents how to disable the recovery environment with reagentc /disable, delete and recreate the recovery partition at the end of the disk, and re-enable it; do this only if you're comfortable with diskpart.
  • Free space before C:: Windows can't extend backwards. Use the space as a new volume, or use a third-party partition tool from a boot USB.

Check that it worked

Reboot. The machine should go straight to Windows with no GRUB menu, and the firmware boot menu (F12 or similar) should no longer list ubuntu. In Disk Management, the freed space now belongs to C: or a new volume. If an ubuntu entry still appears in the firmware menu, the firmware re-created it from a leftover file or keeps stale entries; remove it from the firmware setup or with efibootmgr below.

Removing a firmware entry from Linux (efibootmgr)

If you prefer, or Windows won't boot yet, you can clean the boot entries from any Linux live USB booted in UEFI mode:

sudo efibootmgr -v

Example output:

BootCurrent: 0003
BootOrder: 0001,0000,0003
Boot0000* Windows Boot Manager	HD(1,GPT,...)/File(\EFI\Microsoft\Boot\bootmgfw.efi)
Boot0001* ubuntu	HD(1,GPT,...)/File(\EFI\ubuntu\shimx64.efi)
Boot0003* UEFI: USB Flash Drive
# delete the ubuntu entry (Boot0001)
sudo efibootmgr -b 0001 -B
# make Windows first
sudo efibootmgr -o 0000

Then mount the ESP and remove the folder: sudo mount /dev/nvme0n1p1 /mnt && sudo rm -r /mnt/EFI/ubuntu && sudo umount /mnt. Confirm the partition with lsblk -f first: it is the small vfat one.

Repair Windows boot (grub rescue after deleting Ubuntu)

If you deleted the partitions first and now see grub rescue> or error: unknown filesystem on every boot, GRUB is still being started but its files are gone. Fixes, easiest first:

  1. Boot menu key: press F12, F11, F8 or Esc at power on (varies by vendor), select Windows Boot Manager, then do Step 1 and Step 2 from Windows.
  2. Rebuild the Windows boot files (UEFI): boot the Windows installation USB → Repair your computer → Troubleshoot → Command Prompt:
diskpart
list volume
rem note the letter of the Windows volume (may not be C: here)
exit
bcdboot C:\Windows /f UEFI

bcdboot copies a fresh Windows bootloader to the ESP and creates its firmware entry. Replace C: with the letter list volume showed for the Windows partition.

  1. Legacy BIOS / MBR systems: GRUB is in the disk's master boot record, so deleting EFI\ubuntu doesn't apply. From the Windows USB's Command Prompt, rewrite the MBR boot code:
bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd

bootrec /fixboot may report Access is denied on newer Windows builds; /fixmbr is the step that removes GRUB, and bcdboot C:\Windows /f BIOS is an alternative to /fixboot.

If you'd rather get the Linux install back instead, see fix the grub rescue prompt.

Removing other distros, or replacing Ubuntu

The same steps apply to Fedora (EFI\fedora, often with a separate /boot partition and btrfs), Linux Mint (EFI\ubuntu, since Mint uses Ubuntu's bootloader), Debian (EFI\debian), openSUSE (EFI\opensuse) and Arch (often EFI\GRUB or EFI\systemd). If you only want to switch distros, you don't need to remove anything first: the new installer can replace the Linux partitions and will take over the existing EFI entry. Choose "Something else" / manual partitioning in the installer and select the old Linux partitions; the Ubuntu install guide covers this. Microsoft's reference for the commands above is the BCDBoot documentation.

Frequently asked questions

Can I just delete the Ubuntu partition from Windows?

You can, but on UEFI systems the firmware may still boot GRUB first, which then shows grub rescue> because its files are gone. Set Windows Boot Manager as the first boot entry, or remove the Ubuntu EFI entry, before or right after deleting the partitions.

Will removing Ubuntu delete my Windows files?

No, as long as you delete only the Linux partitions (ext4, btrfs, swap) and leave the EFI system partition, the Windows (NTFS) partition and the recovery partition alone. Back up first anyway.

How do I remove Ubuntu from the boot menu?

Delete the EFI\ubuntu folder from the EFI system partition and remove its firmware boot entry with bcdedit /delete in Windows or efibootmgr -B from a Linux live USB.

Why can't I extend my C: drive after deleting Ubuntu?

Windows can only extend into unallocated space directly after the partition. If the recovery partition sits between C: and the free space, you need to move or recreate it, or use the space as a separate drive.

Do I need my BitLocker recovery key?

Possibly. Changing the boot configuration can trigger BitLocker recovery on the next boot. Get the key from your Microsoft account or manage-bde -protectors -get C: before you start.

Spotted a mistake or a command that no longer works? Send a correction — pages are re-checked when reports come in.