If you've accidentally deleted the boot partition while messing around with Linux, you might find yourself in a situation where your Windows system won't boot, and the GRUB bootloader doesn't recognize it. In this article, we'll guide you through the process of reinstalling the Windows bootloader to restore your system to a bootable state.
Understanding the Windows Bootloader
The Windows bootloader is a piece of software that runs when you start your computer. It's responsible for loading the Windows operating system and providing you with the familiar Windows boot screen. When you delete the boot partition, you remove the location where the bootloader is stored, causing the system to become unbootable.
Reinstalling the Windows Bootloader
To reinstall the Windows bootloader, you'll need to boot your computer from a Windows installation media, such as a DVD or USB drive. Once you've booted from the installation media, you'll be presented with the Windows Setup screen. From here, you can access the command prompt and begin the process of reinstalling the bootloader.
Accessing the Command Prompt
To access the command prompt, follow these steps:
- Click on
Repair your computer. - Click on
Troubleshoot. - Click on
Advanced options. - Click on
Command Prompt.
Reinstalling the Bootloader
Once you have access to the command prompt, you can reinstall the bootloader by executing the following commands:
diskpart
list disk
select disk
list partition
select partition
active
exit
bcdboot c:\windows /s
Where c:\windows is the location of the Windows installation, is the disk number where Windows is installed, and is the drive letter of the system partition. After executing these commands, the Windows bootloader should be reinstalled, and your system should be bootable again.
Additional Considerations
There are a few things to keep in mind when reinstalling the Windows bootloader:
- Make sure you have the correct disk number and partition letter before executing the
bcdbootcommand. Incorrect values can cause further issues with your system. - If you're using BitLocker, you may need to unlock the drive before reinstalling the bootloader. The BitLocker drive will be automatically locked when you delete the boot partition.
- If your system still won't boot after reinstalling the bootloader, you may need to repair the Windows installation. This can be done using the
startrepcommand in the recovery console.