Dav*_*d Z 18 boot windows-7 bootloader partitioning
我有一个使用 GRUB2 双引导 Gentoo Linux 和 Windows 7 的系统。计算机有四个驱动器,Windows 安装在驱动器 #2 的第三个(最后一个)分区上。驱动器布局如下所示:
|boot|-----------------home-----------------|-------------windows-------------|
Run Code Online (Sandbox Code Playgroud)
(boot
并且home
是 Linux 分区)这是一个奇怪的设置,但它总是有效,直到我决定使用 Gparted 缩小 Windows 分区。新的布局是:
|boot|-----------------------home-----------------------|-------windows-------|
Run Code Online (Sandbox Code Playgroud)
进行这些分区更改后,当我在 GRUB2 中选择 Windows 选项并将控制权移交给 Windows 引导加载程序时,我收到错误消息:
Windows 启动管理器
Windows 无法启动。最近的硬件或软件更改可能是原因。 要解决问题: 1. 插入 Windows 安装光盘并重新启动计算机。 2. 选择您的语言设置,然后单击“下一步”。 3. 单击“修复您的计算机”。 如果您没有此光盘,请联系您的系统管理员或计算机 制造商寻求帮助。 状态:0xc0000225 信息:启动选择失败,因为无法访问所需的设备。
发生这种情况我并不特别惊讶,但我想知道是否可以在不重新安装 Windows 的情况下解决此问题。
我尝试使用 Windows 安装 DVD(特别是 Windows 7 升级 DVD)启动计算机。在我选择语言和键盘并单击“修复此计算机”后,系统恢复选项屏幕未检测到我的 Windows 分区。我仍然可以单击“下一步”,然后使用无法解决问题的启动修复,或者尝试命令行工具,即bootrec
(由多个网站推荐)、sfc
、 和chkdsk
。他们都没有改变。我仍然收到相同的错误消息。(有关详细输出,请参见下文。)
同样如类似问题中所建议的那样,我尝试使用TestDisk 中的“重建 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
}
Run Code Online (Sandbox Code Playgroud)
同样,理想情况下,我正在寻找一种无需重新安装 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
Run Code Online (Sandbox Code Playgroud)
当我在连接所有驱动器的情况下运行相同的命令时,输出是相同的,除了diskpart
正确显示所有驱动器,并且有问题的 Windows 分区的驱动器号D
不是C
(因为我在驱动器 #1 上有一个 NTFS 数据分区)。
我会注意到它会bootrec /fixmbr
覆盖驱动器 #2 的 MBR,用 GRUB2 替换放置在那里的 MBR。当我然后尝试从该磁盘启动时,我只是收到消息“缺少操作系统”而不是 0xc0000225 错误。然后我可以启动到 Linux 并用于grub-install
放回 GRUB2 MBR,然后在 GRUB2 中选择 Windows 选项再次给出 0xc0000225。
Tam*_*man 12
根据使用的方法,某些事情可能会在进程中发生变化:
分区详情:active
在diskpart中使用,使分区再次激活。
引导扇区: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
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
110039 次 |
最近记录: |