Windows + Ubuntu 双系统启动故障修复:从 0xc0000225 到恢复 GRUB 双启动
1. 问题背景
电脑安装了 Windows 10 + Ubuntu 双系统 ,采用 UEFI + GPT 分区方式。
系统结构:
- Windows 10 安装在 NTFS 分区
- Ubuntu 安装在另一块硬盘
- 两个系统共用 EFI 启动分区
- 使用 UEFI Firmware 管理启动项
某次启动 Windows 时出现:
Recovery
Your PC couldn't start properly
Error code: 0xc0000225
随后 Windows 无法启动。
目标:
-
修复 Windows 启动
-
保留 Ubuntu
-
恢复开机选择:
Ubuntu
Windows Boot Manager
2. 故障现象分析
大前提: 最好使用微软官方的MediaCreationTool_22H2.exe下载镜像, 然后使用U盘做启动。尝试过rufus, 失败了
2.1 Windows 报错
错误:
0xc0000225
含义:
Windows Boot Manager 无法找到正确的启动配置。
主要涉及:
BCD
(Boot Configuration Data)
即:
Windows 启动配置数据库损坏或者路径错误。
启动流程:
BIOS/UEFI
|
↓
EFI System Partition
|
↓
Microsoft\Boot\bootmgfw.efi
|
↓
BCD
|
↓
Windows\System32\winload.efi
|
↓
Windows Kernel
故障位置:
EFI
|
Microsoft\Boot
|
BCD
3. 第一阶段:确认磁盘结构
进入 Windows PE:
X:\Sources>
执行:
cmd
diskpart
list volume
查看分区。
结果:
C:
NTFS
499GB
D:
NTFS
1000GB
E:
NTFS
363GB
S:
ESP_EFI
FAT32
200MB
关键:
S:
FAT32 200MB
说明:
这是 EFI System Partition。
里面存放:
EFI
├── Microsoft
│ └── Boot
│
└── ubuntu
├── shimx64.efi
└── grubx64.efi
说明:
Ubuntu 引导文件仍然存在。
4. 第二阶段:修复 Windows 系统文件
执行:
cmd
sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
命令解释
sfc
System File Checker
Windows 系统文件检查器。
作用:
扫描:
C:\Windows
中的系统文件。
检查:
dll
exe
sys
是否损坏。
/scannow
表示:
扫描全部系统文件。
/offbootdir
指定离线 Windows 启动目录。
例如:
cmd
/offbootdir=C:\
表示:
Windows 安装不在当前运行系统,而是在 C 盘。
/offwindir
指定 Windows 系统目录:
cmd
/offwindir=C:\Windows
告诉 SFC:
我要修复的是 C:\Windows,而不是 PE 自己的 Windows。
执行结果
显示:
Windows 资源保护找到损坏文件并成功修复了它们
说明:
Windows 系统文件恢复成功。
5. 第三阶段:检查 Windows BCD
执行:
cmd
bcdedit /enum firmware
看到:
Windows Boot Manager
device partition=S:
path
\EFI\Microsoft\Boot\BOOTMGFW.EFI
Windows Boot Loader
device partition=C:
path
\Windows\system32\winload.efi
说明:
Windows EFI 文件存在。
同时看到:
EFI\UBUNTU\SHIMX64.EFI
说明:
Ubuntu EFI 也存在。
因此:
不是 Ubuntu 被删除。
6. 第四阶段:重建 Windows BCD
执行:
cmd
bcdboot C:\Windows /s S: /f UEFI
作用:
重新生成:
S:\EFI\Microsoft\Boot\BCD
重新注册:
Windows Boot Manager
参数:
| 参数 | 作用 |
|---|---|
| C:\Windows | Windows系统目录 |
| /s S: | 指定EFI分区 |
| /f UEFI | 生成UEFI启动文件 |
执行成功:
Boot files successfully created
说明:
Windows启动链恢复。
7. 第五阶段:修复 Windows 系统组件
执行:
cmd
DISM /image:C:\ /cleanup-image /restorehealth
DISM作用
DISM:
Deployment Image Servicing and Management
用于维护:
Windows Image
类似:
Windows系统镜像修复工具。
参数解释
/image:C:\
指定离线 Windows:
C:\Windows
因为现在是在 PE 环境。
/cleanup-image
检查系统映像。
/restorehealth
修复损坏组件。
执行结果:
还原操作已成功完成
说明:
Windows组件恢复完成。
8. Windows 可以启动,但是出现新的问题
修复后:
Windows 可以正常进入。
但是:
开机直接进入 Windows。
没有:
Ubuntu
Windows
选择。
9. 根本原因分析
表面原因
Windows BCD损坏:
导致:
0xc0000225
深层原因
双系统启动顺序被改变。
UEFI启动项:
之前:
ubuntu
|
GRUB
|
Windows Boot Manager
现在:
Windows Boot Manager
|
Windows
也就是说:
UEFI绕过 GRUB。
启动流程变成:
UEFI
↓
Windows Boot Manager
↓
Windows
Ubuntu虽然存在:
但是没有机会执行。
10. 最终解决方案:恢复 GRUB 管理启动
进入 BIOS:
Gigabyte 主板:
Advanced Mode
Boot
看到:
Boot Option #1
Windows Boot Manager
下面:
ubuntu (KINGSTON...)
ubuntu (...)
调整:
改为:
Boot Option #1
ubuntu
保存:
F10
重启。
11. 恢复后的启动流程
最终:
UEFI BIOS
|
↓
Ubuntu GRUB
|
+----------------+
| |
↓ ↓
Ubuntu Windows Boot Manager
启动菜单:
GNU GRUB
Ubuntu
Advanced options for Ubuntu
Windows Boot Manager
双系统恢复。
12. 如果 GRUB 没有 Windows
进入 Ubuntu:
执行:
bash
sudo update-grub
输出:
Found Windows Boot Manager
然后:
bash
sudo reboot
13. 本次故障总结
直接原因
Windows启动配置损坏:
BCD损坏
导致:
0xc0000225
根本原因
双系统环境下:
UEFI启动顺序改变。
Windows Boot Manager 被设置为第一启动项。
导致:
GRUB失去控制权
所以:
Ubuntu选项消失。
14. 故障解决路线总结
Windows无法启动
|
↓
检查EFI分区
|
↓
确认Ubuntu没有损坏
|
↓
SFC修复系统文件
|
↓
BCDBOOT重建Windows EFI
|
↓
DISM修复系统组件
|
↓
Windows恢复启动
|
↓
BIOS调整启动顺序
|
↓
Ubuntu GRUB恢复
|
↓
Windows + Ubuntu双启动恢复
15. 经验总结
对于 Windows + Linux 双系统 UEFI 环境:
最重要的三个组件:
| 组件 | 作用 |
|---|---|
| EFI System Partition | 存放启动文件 |
| BCD | Windows启动数据库 |
| GRUB | Linux启动管理器 |
遇到问题时:
不要直接重装系统。
推荐顺序:
- 查看 EFI 分区
- 检查启动项
- 修复 BCD
- 修复 Windows 文件
- 恢复 GRUB
本次故障最终证明:
Windows 和 Ubuntu 都没有损坏,真正的问题是 Windows BCD损坏 + UEFI启动优先级变化导致双系统启动链断裂。