Remove Ubuntu from Dual-Boot System
This comprehensive guide explains how to safely remove Ubuntu from a Windows dual-boot system, clean up partitions, and restore the Windows bootloader. Follow these steps carefully to avoid data loss and system issues.
Removing Ubuntu involves deleting partitions and modifying system boot files. Always backup important data before proceeding. Incorrect execution can make your system unbootable.
Overview
When Ubuntu is installed alongside Windows in a dual-boot configuration, it typically:
- Creates Linux partitions (root, swap, sometimes home)
- Installs GRUB bootloader to manage boot options
- Adds EFI entries for Linux boot process
- Modifies system boot sequence
Proper removal requires:
- Backing up important data
- Removing Ubuntu EFI entries
- Deleting Ubuntu partitions
- Restoring Windows bootloader
- Reclaiming disk space
Prerequisites
Required Access
- Windows Administrator privileges
- Physical access to the computer
- Windows installation media (for recovery if needed)
Recommended Preparations
- Complete data backup of important files
- Create Windows recovery drive
- Document current partition layout
- Note Ubuntu version and installation details
System Requirements
- UEFI-based system (most modern computers)
- Windows 10/11 with Disk Management tools
- Stable power supply during the process
Understanding Your Current Setup
Identify Dual-Boot Configuration
Before proceeding, understand your current setup:
# Open Command Prompt as Administrator
# Check current boot configuration
bcdedit /enum firmware
# Check disk configuration
diskpart
list disk
list partition
Common Dual-Boot Layouts
Typical UEFI Dual-Boot Setup:
Disk 0:
├── EFI System Partition (ESP) - 100-500MB FAT32
│ ├── /EFI/Microsoft/ (Windows boot files)
│ └── /EFI/ubuntu/ (Ubuntu boot files)
├── Windows C: Drive - NTFS
├── Ubuntu Root (/) - ext4
├── Ubuntu Swap - linux-swap
└── Ubuntu Home (/home) - ext4 (optional)
Check Current Partitions
-
Open Disk Management:
- Right-click "This PC" → "Manage" → "Disk Management"
- Or press
Win + X
→ "Disk Management"
-
Identify Ubuntu partitions:
- Look for partitions without drive letters
- Usually shows as "Healthy (Primary Partition)"
- May show file system types like "ext4" or "linux-swap"
Method 1: Safe Removal (Recommended)
Step 1: Backup Important Data
# If Ubuntu is still bootable, backup data first
# Boot into Ubuntu and copy important files to external storage
sudo rsync -av /home/username/ /media/backup/
Step 2: Remove Ubuntu EFI Entries
Access EFI System Partition
- Open Command Prompt as Administrator
- Launch Diskpart:
diskpart
- List and select the disk:
# Display all disks
list disk
# Select disk containing Windows (usually disk 0)
select disk 0
- List and select EFI partition:
# Display partitions
list partition
# Select EFI System Partition (usually partition 1, ~100-500MB)
select partition 1
# Assign temporary drive letter
assign letter=Z
Remove Ubuntu EFI Files
-
Open File Explorer as Administrator:
- Right-click File Explorer → "Run as administrator"
-
Navigate to EFI partition:
- Go to
Z:\EFI\
- You should see folders like
Microsoft
,ubuntu
,Boot
- Go to
-
Delete Ubuntu folder:
- Right-click
ubuntu
folder → "Delete" - Confirm deletion
- Right-click
Clean Up Drive Letter
Return to Diskpart:
# Remove the assigned drive letter
remove letter=Z
# Exit diskpart
exit
Step 3: Remove Ubuntu Partitions
Using Disk Management (GUI Method)
-
Open Disk Management:
- Press
Win + X
→ "Disk Management"
- Press
-
Identify Ubuntu partitions:
- Look for partitions without drive letters
- Usually appear as "Healthy (Primary Partition)"
- Common sizes: 20GB+ for root, 2-8GB for swap
-
Delete Ubuntu partitions:
- Right-click each Ubuntu partition
- Select "Delete Volume"
- Confirm deletion
- Partitions become "Unallocated"
Using Diskpart (Command Line Method)
# Open diskpart as administrator
diskpart
# List and select disk
list disk
select disk 0
# List partitions
list partition
# Delete Ubuntu partitions (replace X with partition number)
select partition X
delete partition
# Repeat for all Ubuntu partitions
Step 4: Extend Windows Partition
-
In Disk Management:
- Right-click Windows C: drive
- Select "Extend Volume"
- Follow wizard to use unallocated space
-
Alternative using Diskpart:
diskpart
list disk
select disk 0
list partition
select partition 2 # Windows partition
extend # Uses all available space
Step 5: Restore Windows Boot Manager
Update Boot Configuration
# Open Command Prompt as Administrator
# Rebuild BCD store
bcdedit /export C:\BCD_Backup
bcdboot C:\Windows /s C: /f UEFI
# Remove any remaining Ubuntu entries
bcdedit /enum firmware
# Note the identifier of Ubuntu entries
bcdedit /delete {ubuntu-identifier}
Verify Boot Configuration
# Check current boot options
bcdedit /enum firmware
# Set Windows as default
bcdedit /default {current}
# Set boot timeout
bcdedit /timeout 5
Method 2: Emergency Removal
If Ubuntu is corrupted or unbootable:
Step 1: Boot from Windows Recovery
- Create Windows Recovery Drive (if not already available)
- Boot from recovery media
- Access Command Prompt from recovery options
Step 2: Emergency EFI Cleanup
# In recovery command prompt
diskpart
list disk
select disk 0
list partition
select partition 1 # EFI partition
assign letter=Z
exit
# Navigate and delete Ubuntu files
Z:
cd EFI
dir
rmdir /s ubuntu
# Remove drive letter
diskpart
select disk 0
select partition 1
remove letter=Z
exit
Step 3: Repair Windows Boot
# Repair Windows boot files
bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd
# Alternative method
bcdboot C:\Windows /s C: /f UEFI
Advanced Scenarios
Multiple Linux Distributions
If you have multiple Linux distributions:
# List all EFI entries
bcdedit /enum firmware
# Remove specific entries
bcdedit /delete {linux-entry-id}
# In EFI partition, check folders
Z:\EFI\
├── Microsoft\
├── ubuntu\
├── fedora\
└── arch\
Encrypted Ubuntu Installation
For encrypted Ubuntu (LUKS):
- Ubuntu partitions may not be visible in Windows
- Use Linux live USB to decrypt and backup data first
- Proceed with normal removal steps
- Encrypted partitions appear as regular partitions to Windows
Custom GRUB Configuration
If GRUB was customized:
# Check for custom boot entries
bcdedit /enum all
# Remove custom entries
bcdedit /delete {custom-id}
# Reset to Windows default
bcdedit /set {fwbootmgr} displayorder {bootmgr}
Troubleshooting
Boot Issues After Removal
System Won't Boot
Solution 1: Windows Recovery
# Boot from Windows installation media
# Choose "Repair your computer"
# Select "Troubleshoot" → "Advanced options" → "Command Prompt"
bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd
Solution 2: UEFI Boot Repair
# In recovery command prompt
bcdboot C:\Windows /s C: /f UEFI
# If EFI partition needs repair
diskpart
select disk 0
select partition 1
format fs=fat32 quick
assign letter=Z
exit
bcdboot C:\Windows /s Z: /f UEFI
GRUB Still Appears
If GRUB bootloader still appears:
# Check EFI boot order
bcdedit /enum firmware
# Set Windows as first boot option
bcdedit /set {fwbootmgr} displayorder {bootmgr} {other-entries}
# Access BIOS/UEFI settings
# Set Windows Boot Manager as first boot option
Partition Issues
Can't Delete Ubuntu Partitions
Possible causes:
- Partitions are mounted or in use
- System protection is enabled
- Third-party software interference
Solutions:
# Force delete in diskpart
diskpart
select disk 0
select partition X
inactive # If partition is active
delete partition override
# Use third-party tools if needed
# - GParted Live USB
# - EaseUS Partition Master
# - MiniTool Partition Wizard
Unallocated Space Can't Be Extended
Common issue: Unallocated space not adjacent to Windows partition
Solution:
- Use third-party partition manager
- Move partitions to make space adjacent
- Then extend Windows partition
Data Recovery
Accidentally Deleted Wrong Partition
Immediate actions:
- Stop using the computer immediately
- Boot from external media only
- Use data recovery tools:
- TestDisk & PhotoRec
- R-Studio
- Recuva
# Using TestDisk (from Linux Live USB)
sudo apt install testdisk
sudo testdisk
# Follow prompts to recover partition table
Verification and Cleanup
Verify Complete Removal
-
Check Disk Management:
- No unrecognized partitions
- All space allocated to Windows
-
Check Boot Configuration:
bcdedit /enum firmware
# Should only show Windows entries -
Check EFI Partition:
# Temporarily assign drive letter
diskpart
select disk 0
select partition 1
assign letter=Z
# Check EFI folder contents
dir Z:\EFI\
# Should only contain Microsoft and Boot folders
# Remove drive letter
remove letter=Z
System Optimization
After removal:
-
Run Disk Cleanup:
- Remove temporary files
- Clean system files
-
Defragment Hard Drive (if using HDD):
defrag C: /O
-
Check System Files:
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
Update System
# Check for Windows updates
# Settings → Update & Security → Windows Update
# Update drivers
# Device Manager → Check for hardware changes
Prevention and Best Practices
Before Installing Linux Again
-
Use Virtual Machines for testing:
- VMware Workstation
- VirtualBox
- Hyper-V
-
Use Windows Subsystem for Linux (WSL):
wsl --install
wsl --install -d Ubuntu -
Use portable Linux:
- Live USB with persistence
- Portable installations
Backup Strategies
-
Regular System Images:
# Create system image
wbadmin start backup -backupTarget:E: -include:C: -allCritical -
EFI Partition Backup:
# Backup EFI partition
xcopy Z:\EFI\ E:\EFI_Backup\ /E /H /C /I
Documentation
Keep records of:
- Partition layouts before changes
- Boot configuration exports
- Installation procedures used
- Custom configurations applied
Alternative Solutions
Keep Ubuntu in Virtual Machine
Instead of dual-boot, consider:
# Install VirtualBox
# Download Ubuntu ISO
# Create VM with adequate resources:
# - 4GB+ RAM
# - 20GB+ storage
# - Enable virtualization features
Windows Subsystem for Linux
For development needs:
# Enable WSL feature
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# Install Ubuntu
wsl --install -d Ubuntu-22.04
# Access Ubuntu
wsl
Portable Linux Solutions
- Ventoy: Multi-boot USB with multiple ISOs
- Rufus: Create persistent live USBs
- Universal USB Installer: Easy Linux USB creation
Resources and References
- Microsoft Diskpart Documentation
- Windows Boot Configuration
- UEFI Boot Process
- TestDisk Data Recovery
- Always backup important data before modifying partitions
- Create Windows recovery media before starting
- Test the process on a virtual machine first if possible
- Keep Linux live USB available for emergency data recovery
- Never delete partitions without confirming their contents
- Always assign temporary drive letters to access EFI partitions safely
- Remove drive letter assignments after completing tasks
- Verify Windows boots correctly before considering the process complete
If something goes wrong:
- Boot from Windows installation media
- Choose "Repair your computer"
- Use Command Prompt to run
bootrec /rebuildbcd
- Restore from system backup if available