我有一个使用 GRUB2 双启动 Gentoo Linux 和 Windows 7 的系统。电脑有四个硬盘,Windows 安装在 2 号硬盘的第三个(最后一个)分区上。硬盘布局如下
|boot|-----------------home-----------------|-------------windows-------------|
(boot "和 "home "是 Linux 分区)这是一个奇怪的设置,但一直都能正常工作,直到我决定使用 Gparted 缩减 Windows 分区。新的布局是
|boot|-----------------------home-----------------------|-------windows-------|
更改分区后,当我在 GRUB2 中选择 Windows 选项并将控制权移交给 Windows 引导加载器时,我收到了错误信息:
Windows引导管理器Windows 启动失败。最近的硬件或软件更改可能是原因。 要解决问题:1.插入 Windows 安装光盘并重新启动计算机。 2. 选择语言设置,然后单击 "下一步"; 3.单击"修复您的计算机.";
如果没有此光盘,请联系系统管理员或计算机 制造商寻求帮助。
状态:0xc0000225
信息:由于无法访问所需设备,启动选择失败;
我对发生这种情况并不感到特别惊讶,但我想知道是否可以在不重新安装 Windows 的情况下解决这个问题。
我试着用 Windows 安装 DVD(特别是 Windows 7 升级 DVD)启动计算机。在我选择语言和键盘并单击"修复此计算机"后,系统恢复选项屏幕出现检测不到我的 Windows 分区。我可以点击 "下一步",然后使用启动修复,但未能解决问题,或者尝试命令行工具,即
bootrec
(几个网站建议使用)、sfc
和chkdsk
。这些工具都不起作用;我仍然收到相同的错误信息。(详细输出见下文)。根据类似问题的建议,我还尝试使用 TestDisk 中的 "Rebuild BS"(重建引导扇区)功能,该功能在 Linux 下运行,作用于 Windows 分区。这也没有改变我遇到的错误。
我在两个分区上都没有看到任何数据损坏的迹象,硬盘也没有受到任何物理损坏,因此似乎可以相当肯定,分区布局的改变是导致该错误的原因。我想 Windows 一定在其文件系统(注册表?)的某个地方存储了起始扇区和/或分区大小,这表明原则上应该可以通过在某个文件中修改几个字节来解决这个问题。但到底是哪个文件呢?还是有更复杂的东西?
下面是与 Windows 相对应的 GRUB2 配置文件:
menuentry 'Windows 7 (loader) (on /dev/sdb3)' --class windows --class os $menuentry_id_option 'osprober-chain-1F9948EB30A986A0' { insmod part_msdos insmod ntfs set root='hd1,msdos3' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos3 --hint-efi=hd1,msdos3 --hint-baremetal=ahci1,msdos3 1F9948EB30A986A0 else search --no-floppy --fs-uuid --set=root 1F9948EB30A986A0 fi chainloader +1 }
再说一遍,我希望找到一种无需重装 Windows 即可解决这一问题的方法。如果不可能,重装系统也是可以接受的 B 计划,但我可以自己解决。
下面是我使用 Windows 7 安装 DVD 启动到修复环境时的命令提示符会话记录。为了便于阅读,我删除了一些空行。以下是所有其他驱动器_断开连接_的情况:
>bootrec /fixmbr The operation completed successfully, >bootrec /fixboot The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. >bootrec /scanos Scanning all disks for Windows installations. Please wait, since this may take a while... Successfully scanned Windows installations. Total identified Windows installations: 1 [1] C:\Windows The operation completed successfully. >bootrec /rebuildbcd Scanning all disks for Windows installations. Please wait, since this may take a while... Successfully scanned Windows installations. Total identified Windows installations: 1 [1] C:\Windows Add installation to boot list? Yes(Y)/No(N)/All(A):y The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. >sfc /verifyonly /offwindir=C:\Windows /offbootdir=C:\ Beginning system scan. This process will take some time. Windows Resource Protection did not find any integrity violations. >chkdsk C: /F The type of the file system is NTFS. Volume label is windows. CHKDSK is verifying files (stage 1 of 3)... 313344 file records processed. File verification completed. 1684 large file records processed. 0 bad file records processed. 2 EA records processed. 158 reparse records processed. CHKDSK is verifying indexes (stage 2 of 3)... 416370 index entries processed. Index verification completed. 0 unindexed files scanned. 0 unindexed files recovered. CHKDSK is verifying security descriptors (stage 3 of 3)... 313344 file SDs/SIDs processed. Security descriptor verification completed. 51514 data files processed. CHKDSK is verifying Usn journal... 35406088 USN bytes processed. Usn Journal verification completed. Windows has checked the file system and found no problems. 207510871 KB total disk space. 104134880 KB in 251224 files. 137304 KB in 51514 indexes. 0 KB in bad sectors. 423075 KB in use by the system. 65536 KB occupied by the log file. 102815612 KB available on disk. 4096 bytes in each allocation unit. 51877717 total allocation units on disk. 25703903 allocation units available on disk. Failed to transfer logged messages to the event log with status 50. >diskpart Microsoft DiskPart version 6.1.7600 Copyright (C) 1999-2008 Microsoft Corporation. On computer: MININT-P92LVUL DISKPART>list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 596 GB 0 B DISKPART>select disk 0 Disk 0 is now the selected disk. DISKPART>list part Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 Primary 62 MB 31 KB Partition 2 Primary 398 GB 62 MB Partition 3 Primary 197 GB 398 GB
当我在所有硬盘都已连接的情况下运行相同命令时,输出结果是一样的,只是 "diskpart "正确显示了所有硬盘,而有关 Windows 分区的盘符是 "D "而不是 "C"(因为我在 1 号硬盘上有一个 NTFS 数据分区)。
我需要注意的是,"bootrec /fixmbr "覆盖了 2 号硬盘的 MBR,替换了 GRUB2 放在那里的 MBR。当我尝试从该磁盘启动时,得到的只是 "Missing operating system" 信息,而不是 0xc0000225 错误。然后,我可以启动 Linux 并使用
grub-install
重新安装 GRUB2 MBR,然后在 GRUB2 中选择 Windows 选项,又会出现 0xc0000225。
根据所使用的方法,某些事情会在进展中发生变化:
分区详细信息:使用 diskpart 中的 active
使分区再次激活。
引导扇区:可使用 bootsect 工具恢复引导扇区。(例如:"bootsect /nt60 C:`)
分区 UUID:通过更改分区位置和/或大小,UUID 会发生变化;因此 BCD 中存储的不可访问 UUID 与分区的 UUID 不匹配。要解决这个问题,请像这样删除*并重建 BCD:
bcdedit /export C:\boot\bcd.backup
ren C:\boot\bcd C:\boot\bcd.old
bootrec /rebuildbcd
您可能因为过多减少 Windows 分区而导致问题。
Windows 有一些无法移动的文件,第三方产品可能会决定移动这些文件。 今后应使用 Windows 磁盘管理器调整分区大小、 因为这样做不会损坏磁盘。此外,最好先关闭并清空 回收站,禁用分页文件和休眠,以便尽量减少 运行磁盘碎片整理程序,将所有文件压缩到磁盘开头。 压缩磁盘开头的所有文件。
也就是说,你可以进行修复安装以修复 Windows 7。 这种温和的安装方式可以修复当前安装的 Windows 7 并保留用户账户、数据、程序和系统驱动程序。 链接文章通过截图详细描述了这一过程。 之后,您可能需要处理 GRUB2 引导扇区受到的一些破坏。
如果 "修复安装 "不起作用,则说明 Gparted 已破坏了 Windows 分区。 我希望你在这种情况下有备份,否则你可能不得不求助于 数据恢复实用程序。
我的电脑在升级到 Windows 10 时也遇到了类似的问题(错误代码 0xc0000225)。
问题源于我的一个硬盘上仍有一个空的 EFI 分区。启动时,电脑会发现 2 个 EFI 分区:一个是我的主操作系统,另一个是我几个月前卸载的旧操作系统(我从第一个硬盘移到固态硬盘,并格式化了所有内容)。
也许这也是你的问题。我有两个解决方案,希望能帮到你:
我还重新安装了 Windows,但如果你删除了坏的 EFI 分区,这就足够了。
从那以后,启动时再也没有问题了,我的电脑可以安装 W10 等。
抱歉,我没有告诉您需要点击的东西的确切名称,我的操作系统是法语的 ^^