我有一个使用GRUB2双重启动Gentoo Linux和Windows 7的系统。该计算机具有四个驱动器,并且Windows安装在驱动器#2的第三个(最后一个)分区上。驱动器布局如下所示:
|boot|-----------------home-----------------|-------------windows-------------|
(boot
并且home
是Linux分区),这是一个奇怪的设置,但始终有效,直到我决定使用Gparted缩小Windows分区。新的布局是:
|boot|-----------------------home-----------------------|-------windows-------|
更改了这些分区之后,当我在GRUB2中选择Windows选项并将其移交给Windows Bootloader时,我收到错误消息:
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。然后,当我尝试从该磁盘启动时,仅收到消息“缺少操作系统”,而不是0xc0000225错误。然后,我可以启动Linux并用于grub-install
放回GRUB2 MBR,然后在GRUB2中选择Windows选项再次给出0xc0000225。