How to remove bootloader of linux from windows #diskpart #cmd #windows #windows10 #boot #bootloader

 #diskpart #cmd #windows #windows10 

Create disk and manage partition

delete the partition of linux OR YOU CAN DO THIS AFTER DELETING ENTRIES OF LINUX

then open cmd as an admin

diskpart

list disk

select disk #disknumber 

list partition

assign letter=z # to an 100mb

exit

z:

dir

cd EFI

rd ubuntu /s


bcdedit /enum firmware

bcdedit /delete #entries {6f7a0922-887f-11ef-a471-806e6f6e6963} - something like this.


#parition jo mujhe delete karni hai - J,K,M,Y & Z.


fix the bootloader of windows .


To remove the GRUB bootloader (from Ubuntu/Debian) and restore Windows bootloader (Windows Boot Manager), follow these steps carefully.

⚠️ Only do this if you've already removed Linux (Ubuntu/Debian) from your system. If Linux is still installed and you remove GRUB, your system may become unbootable.


Step-by-Step Guide to Remove Ubuntu/Debian Bootloader (GRUB) and Restore Windows Bootloader


🔹 Step 1: Boot into Windows

Make sure you're logged into Windows 10 or 11.


🔹 Step 2: Open Command Prompt as Administrator

Press Win + S and search for cmd.

Right-click on Command PromptRun as administrator.


🔹 Step 3: Repair the Windows Bootloader

Type the following commands one by one and press Enter after each:

bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi

Then reboot:

shutdown /r /t 0

This sets Windows Boot Manager as the default and bypasses GRUB.


🔹 Step 4: Optional – Remove Ubuntu/Debian Boot Entry from UEFI

Sometimes, the GRUB entry remains in the UEFI boot menu (even if it's not active). Here's how to remove it:

Option A: Use bcdedit to list and remove entries (Windows)

Unfortunately, bcdedit won't always show Linux entries stored in UEFI.

Option B: Use Windows PowerShell and bcdedit

Still, if visible, you can do:

bcdedit /enum firmware

Look for entries related to Ubuntu/Debian, note the {identifier}, then delete using:

bcdedit /delete {identifier}

Option C: Use UEFI Firmware Settings

Reboot your PC and enter BIOS/UEFI setup (Del, F2, or Esc during boot depending on your PC).

Look for Boot Order / Boot Menu.

Remove or disable entries like ubuntu or debian.

Save and exit.


🔹 Step 5: Optional – Delete the Ubuntu/Debian Partition

Press Win + X → choose Disk Management.

Locate partitions used by Ubuntu/Debian (typically ext4 or "Healthy (Primary Partition)" with no drive letter).

Right-click on those partitions → Delete Volume.

You can then extend your Windows partition to reclaim space.


Done! Now Your System Will Boot Directly into Windows

Let me know if you also want to reclaim the space from Ubuntu partitions or create a dual boot again in the future.


 

Thanks for letting me know. If the GRUB bootloader is still showing up when you start your PC, let’s use a more thorough method using the Windows recovery tools to fully remove GRUB and restore the Windows Bootloader (EFI-based system).


Full Working Method to Remove GRUB and Restore Windows Bootloader

🔧 You will need:

A Windows 10/11 bootable USB (can be created using the Windows Media Creation Tool or Rufus).


🔹 Step 1: Boot from Windows Installation USB

Insert the USB and restart your PC.

Enter BIOS/UEFI (press F2, DEL, F10, or similar during boot).

Set the USB as the first boot device, then save and restart.

Once the installer starts, choose your language, then click Next.

Click "Repair your computer" (bottom-left corner).

Select TroubleshootAdvanced optionsCommand Prompt.


🔹 Step 2: Rebuild the EFI Bootloader

Now type the following commands one by one:

diskpart

Then list disks:

list disk

Identify the disk where Windows is installed (usually Disk 0), then:

select disk 0

list partition

Find the EFI System Partition (usually 100–300 MB, FAT32). Then:

select partition X    ← Replace X with the EFI partition number

assign letter=S:

exit

Now run the boot repair:

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

Replace C: if your Windows partition is on a different letter. You can check with dir C:.

You should see:

Boot files successfully created.


🔹 Step 3: Reboot and Check

Type:

exit

Then restart your system. It should now boot directly into Windows with GRUB removed.


🔹 Step 4 (Optional): Remove Leftover GRUB Entries from UEFI

Once back in Windows, press Win + R, type: cmd, right-click and choose Run as Administrator.

Type:

bcdedit /enum firmware

If you see Linux entries (ubuntu/debian), delete them like this:

bcdedit /delete {identifier}


Final Step (Optional): Delete Ubuntu/Debian Partitions

Press Win + X → Disk Management.

Right-click on the old Ubuntu partitions (ext4 — usually unrecognized in Windows) and select Delete Volume.

Extend your Windows partition to take up the free space if desired.


Let me know if you need help identifying your EFI partition or which letter your Windows drive is using in the recovery environment. I can guide you step-by-step based on your screen output.

 


Comments