How to Remove Orphan Linux Boot Entries from Windows 11 UEFI

How to Remove Orphan Linux Boot Entries from Windows 11 UEFI

posted Originally published at dev.to 3 min read

Level: Intermediate
Estimated Time: 15–20 minutes
Operating System: Windows 11 (UEFI systems)


Summary

After replacing a Linux installation (such as Pop!_OS, Ubuntu, or Arch Linux) with Windows 11, old boot entries may remain visible in UEFI firmware.

This happens because UEFI boot configuration is stored in:

  1. EFI System Partition (ESP)
  2. UEFI NVRAM boot entries

Both must be cleaned.

⚠️ Before you start: Backup your data. Modifying the EFI partition or NVRAM entries can make your system unbootable if done incorrectly.


Technical Background

EFI System Partition (ESP)

The EFI System Partition (ESP) is a FAT32-formatted partition that stores the bootloaders for all installed operating systems. On Windows systems, it typically ranges from 100–500 MB in size and is labeled as "System".

Typical structure:

EFI/
├── Microsoft/
├── Boot/
├── pop_os/
├── systemd/
├── ubuntu/
└── linux/

⚠️ Do NOT remove:

  • Microsoft/
  • Boot/

NVRAM Boot Entries

UEFI firmware stores boot entries in non-volatile memory.

Each entry contains:

  • GUID identifier
  • Description
  • Path to EFI loader
  • Device reference

Removing EFI files does not remove NVRAM entries.


Step 1 — Mount EFI Partition

Open Command Prompt as Administrator.

diskpart
list disk
select disk 0
list partition

⚠️ Replace 0 with your system disk number.

select partition 1
assign letter=Z
exit

⚠️ Replace 1 with the EFI partition (~100–500 MB, Type: System)


Step 2 — Remove Linux Bootloader Files

Z:
cd \EFI
dir

Remove Linux folders:

rmdir /s /q systemd
rmdir /s /q pop_os

Parameters:

  • /s → removes directories recursively
  • /q → quiet mode (no confirmation)

Permission Errors

takeown /f systemd /r /d y

Parameters:

  • /f → target folder
  • /r → recursive
  • /d y → auto confirm

On Portuguese Windows, use /d s instead of /d y.

icacls systemd /grant Administrators:F /t
rmdir /s /q systemd

Step 3 — Remove NVRAM Boot Entries

3.1 List firmware entries

bcdedit /enum firmware

Example output:

Firmware Application (101fffff)
-------------------------------
identifier              {29c75bf6-3303-11f1-b7f4-e7fe7d8485ec}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\systemd\systemd-bootx64.efi
description             Pop!_OS

Firmware Application (101fffff)
-------------------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager

3.2 Identify entries to remove

Remove entries that reference:

  • systemd
  • pop_os
  • ubuntu
  • linux

3.3 Delete orphan entry

bcdedit /delete {29c75bf6-3303-11f1-b7f4-e7fe7d8485ec} /f

Parameter:

  • /f → force deletion without confirmation

⚠️ NEVER delete:

  • {bootmgr}
  • {current}

Step 4 — Remove drive letter

diskpart
select disk 0
select partition 1
remove letter=Z
exit

Troubleshooting

Problem 1 — Access denied

takeown /f systemd /r /d y
icacls systemd /grant Administrators:F /t
rmdir /s /q systemd

Problem 2 — delete fails

Possible causes:

  • entry already removed
  • firmware protected entry
  • invalid reference

Solution:

  • reboot
  • remove EFI files first
  • run again

Problem 3 — entry still appears

Possible causes:

  • firmware cache
  • fallback recreated
  • BIOS bug

Solutions:

  • reboot twice
  • load BIOS defaults
  • update BIOS

Problem 4 — Windows does not boot

Method 1 — Startup Repair

  1. Boot Windows installer USB
  2. Repair your computer
  3. Startup Repair

Method 2 — Recovery Command Prompt

bcdboot C:\Windows /s Z: /f UEFI

Commands Used

Command Purpose Documentation
diskpart Disk and partition management https://learn.microsoft.com/windows-server/administration/windows-commands/diskpart
bcdedit Manage firmware boot entries https://learn.microsoft.com/windows-hardware/drivers/devtest/bcdedit
takeown Take ownership of files https://learn.microsoft.com/windows-server/administration/windows-commands/takeown
icacls Modify permissions https://learn.microsoft.com/windows-server/administration/windows-commands/icacls
rmdir Remove directories https://learn.microsoft.com/windows-server/administration/windows-commands/rmdir
bcdboot Rebuild Windows bootloader https://learn.microsoft.com/windows-hardware/manufacture/desktop/bcdboot-command-line-options

Version Notes

Version Date Changes
1.0 April 2026 Initial procedure
1.1 April 2026 Added EFI explanation
1.2 April 2026 Added NVRAM cleanup
1.3 April 2026 Added troubleshooting
1.4 April 2026 Added command table
1.5 April 2026 Added recovery section
1.6 April 2026 Safety and locale improvements

✅ Quick Checklist (click to expand) - [ ] Backup completed - [ ] Disk/Partition numbers verified - [ ] Microsoft/ and Boot/ preserved - [ ] {bootmgr} and {current} not deleted - [ ] Drive letter removed

Tested Environment

  • Windows 11 24H2
  • UEFI firmware
  • GPT disk
  • Pop!_OS systemd-boot

Disclaimer

Backup before modifying EFI partition.
Verify disk and partition numbers carefully.

1 Comment

0 votes

More Posts

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

Why Does the System Clock Break on Windows + Linux Dual Boot?

Igor Giamoniano - Coisa de Dev - Dec 29, 2025

Linux vs Windows Which Operating System is Best?

Dewan Codes - Jan 15, 2025

How to Enable Long Paths on Windows 11?

Winsides.com - Nov 11, 2025

How to Upgrade to Windows 11: Compatibility, Steps, and Solutions

Michael Larocca - Jul 15, 2025
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!