Losing Windows Boot Data: A Dual-Boot Dilemma

Abstract: Restore Windows boot manager in dual-boot setups by recreating EFI entries using bcdboot or Linux tools.

Created: 2026-10-11 by

When the Windows boot manager is accidentally removed during a dual-boot setup with Ubuntu, you can restore functionality by recreating the EFI system partition entries using Linux tools. This process involves identifying the correct disk, mounting the EFI partition, and using bcdboot from a Windows installation media or repairing the bootloader configuration directly within the Ubuntu environment to point back to the existing Windows files.

Understanding the Boot Failure

The issue arises because the Unified Extensible Firmware Interface (UEFI) relies on specific entries in the NVRAM (Non-Volatile RAM) to locate operating systems. When these entries are deleted, either by accident or through aggressive partition management software, the firmware no longer knows where to find the Windows Boot Manager (bootmgfw.efi). Consequently, it falls back to the next available option, which is often your Ubuntu installation.

This scenario is distinct from a corrupted Windows registry or a broken hard drive. The Windows files themselves remain intact on the NTFS partition. The problem is purely at the level of the bootloader configuration stored in the EFI System Partition (ESP). If you have recently used tools like efibootmgr in Linux or formatted partitions incorrectly, you may have inadvertently cleared the Windows entry from the boot order.

Preparation and Diagnostics

Before attempting any repairs, ensure you have access to an Ubuntu live USB or that you can boot into your existing Ubuntu installation if it still functions correctly. You will need terminal access with sudo privileges. First, identify your EFI partition. Open a terminal and run sudo fdisk -l or lsblk -f. Look for a partition labeled "EFI System" or one with the FAT32 file system that is typically 100MB to 500MB in size.

Note the device identifier, such as /dev/sda1 or /dev/nvme0n1p1. It is critical not to confuse this with your main Windows partition, which is usually NTFS and much larger. If you are unsure which partition is the ESP, mount it temporarily to check its contents. A valid ESP will contain folders named Microsoft, ubuntu, and potentially other OS-specific directories.

If you do not have immediate access to a Windows repair environment, you can proceed with Linux-based recovery methods. However, having a Windows Installation Media USB ready is highly recommended for the most reliable fix using native Microsoft tools. For those interested in managing multiple boot managers, see How to Fix Two Windows Boot Managers on a PC: A Dual-Boot Windows 11 and Fedora KDE Issue.

Method One: Using BCDBoot from Windows Media

This is the standard and most robust method for restoring the Windows bootloader. Insert the Windows Installation Media USB and boot from it. Select "Repair your computer" instead of installing Windows. Navigate to Troubleshoot > Advanced Options > Command Prompt.

In the command prompt, you must first identify the drive letter of your EFI partition. In the recovery environment, drive letters may differ from those in the installed OS. Type diskpart and press Enter. Then execute the following commands:

list vol
exit

Look for the volume that is small (around 100-500MB) and has the FAT32 file system. Let's assume it is Drive E:. Next, type exit to leave diskpart. Now, use the bcdboot command to recreate the boot files. Assuming your Windows installation is on Drive C:, run:

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

This command copies the necessary boot files from the Windows directory to the EFI partition specified by S: and sets the firmware type to UEFI. If successful, you should see a message stating "Boot files successfully created." Restart your computer and check if Windows appears in the boot menu.

Method Two: Repairing via Ubuntu Live Environment

If you cannot access Windows repair mode, you can attempt to rebuild the boot configuration from Ubuntu. Boot into your Ubuntu live USB or installed system. Mount the EFI partition to a temporary directory:

sudo mount /dev/sdXY /mnt
sudo mount /dev/sdZW /mnt/boot # Optional: if separate boot partition

Replace sdXY with your EFI partition identifier and sdZW with your root Windows partition if applicable. Use chroot to enter the Windows environment if possible, but this is complex without proper drivers. A simpler approach is to manually copy the boot files. Locate the bootmgfw.efi file in /mnt/EFI/Microsoft/Boot/. Ensure the directory structure exists. If it is missing, create it:

sudo mkdir -p /mnt/EFI/Microsoft/Boot/Backup
sudo cp /mnt/EFI/Microsoft/Boot/bootmgfw.efi /mnt/EFI/Microsoft/Boot/Backup/

Then, reinstall the bootloader using grub-install if you are trying to add Windows to GRUB, but this does not fix the native UEFI entry. To fix the UEFI entry specifically from Linux, you can use efibootmgr to create a new entry pointing to the existing bootmgfw.efi file. However, this requires knowing the exact path and file name. A more foolproof method from Linux is to use the windows-repair tool or similar utilities, but manual recreation via Windows media remains superior.

For cases involving data partitions that need conversion, refer to Converting a Data Partition to a Bootable Partition for Dual-Booting Windows 11 and 10.

Verification and Prevention

After restoring the boot manager, verify the boot order in your BIOS/UEFI settings. Ensure that "Windows Boot Manager" is listed as the first boot option. If Ubuntu boots immediately again, you may need to adjust the priority in the firmware settings. Additionally, consider installing a boot repair tool in Ubuntu, such as boot-repair, which can automatically detect and fix common boot issues.

To prevent future occurrences, avoid deleting partitions labeled "EFI System" unless you are certain they belong to the OS you intend to remove. Always backup your NVRAM boot entries if possible. Be cautious when using partition managers that claim to "optimize" boot sequences, as they may strip non-default entries.

Frequently Asked Questions

Why did my Ubuntu boot immediately after I deleted the Windows entry?

When the primary UEFI entry for Windows is removed, the firmware searches for the next available operating system in its boot list. Since Ubuntu is likely configured as the secondary boot option, it becomes the default fallback. This behavior confirms that the hardware is functional and only the pointer to Windows was lost.

Can I recover Windows boot data without a USB installer?

It is difficult to fully restore the UEFI NVRAM entries without external tools. While you can manually copy files to the EFI partition using Linux, creating the actual firmware entry often requires the bcdboot utility found only on Windows media or advanced Linux bootloaders. A USB installer is the safest route.

Will this process delete my Windows files?

No, the process of recreating the boot manager only affects the small EFI System Partition and the NVRAM settings. Your personal files, applications, and the Windows operating system itself reside on the larger NTFS partition and remain untouched. However, always backup important data before modifying boot configurations.

What if the EFI partition is missing entirely?

If the EFI partition was accidentally formatted or deleted along with the boot entries, you will need to create a new partition of type "EFI System" (FAT32), mount it, and then use bcdboot to populate it with boot files. This is more involved than simply restoring entries and requires careful partition sizing.

Is it safe to use boot-repair in Ubuntu?

Boot-repair is generally safe for fixing GRUB issues, but it may overwrite custom UEFI boot entries. Use it with caution in a dual-boot setup, as it might prioritize Linux over Windows or vice versa depending on your current configuration. Always review the changes it proposes before applying them.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More