标题: 利用MountedDevices切换C、D两个盘符 创建: 2019-07-25 20:06 更新: 2019-07-30 13:17 链接: https://scz.617.cn/windows/201907252006.txt Q: 有两个硬盘,第一个硬盘的第一个分区是XP,第二个硬盘上装有Win7。用dd复制XP到 第二个硬盘的第三个分区,用EasyBCD添加XP到引导菜单,重启引导至XP,登录时有 故障。通过其他手段发现这样引导XP时系统盘盘符不再是C而是D,如何让系统盘盘符 恢复成C盘? A: 张宇平 & scz 2019-07-25 20:06 -------------------------------------------------------------------------- Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices] "\\DosDevices\\C:"=hex:86,56,1f,b4,00,00,50,06,00,00,00,00 "\\DosDevices\\D:"=hex:86,56,1f,b4,00,00,50,06,7d,00,00,00 "\\DosDevices\\E:"=hex:86,56,1f,b4,00,00,60,06,fa,00,00,00 -------------------------------------------------------------------------- 这是示例数据,非原始问题中出故障时的数据。这种键值数据在OS启动过程可能被动 态更新。简单解析一下键值数据: 86 56 1f b4 // +0x0 Disk Signature 00 00 50 06 // +0x4 8字节,little-endian序,表示分区的起始偏移,单位是字节 00 00 00 00 // 0x6500000/(1024*1024)=101MB // 表示C盘前面还有一个101MB的无盘符分区 86 56 1f b4 // +0x0 Disk Signature,D同C,表示位于同一物理硬盘 00 00 50 06 // +0x4 0x7d06500000-0x6500000=0x7d00000000 7d 00 00 00 // 0x7d00000000/(1024*1024*1024)=500GB // 表示C盘大小是500GB,C盘大小只能靠D盘起始偏移推算 86 56 1f b4 // +0x0 Disk Signature,E同C,表示位于同一物理硬盘 00 00 60 06 // +0x4 0xfa06600000-0x7d06500000=0x7d00100000 fa 00 00 00 0x7d00100000/(1024*1024*1024)=500GB // 表示D盘大小是500GB,D盘大小只能靠E盘起始偏移推算 // 无法靠前述数据推算E盘大小 出故障时"\\DosDevices\\C:"的键值数据不再对应原系统盘所在分区,出故障时 "\\DosDevices\\D:"的键值数据对应原系统盘所在分区。在其他系统中离线编辑迁移 后出故障的XP注册表,互换"\\DosDevices\\C:"、"\\DosDevices\\D:"的键值数据即 可排除故障,至少能让迁移后的XP正常启动并登录成功。至于登录XP后的D盘是什么, 可以在XP中根据需要再修正。 "Disk Signature"位于MBR的偏移0x1b8处,用WinHex可以查看,也可以用diskpart查 看。 $ diskpart DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 1863 GB 1024 KB Disk 1 Online 2794 GB 2048 KB * Disk 2 Online 931 GB 1024 KB DISKPART> select disk 0 Disk 0 is now the selected disk. DISKPART> detail disk TOSHIBA DT01ACA200 Disk ID: B41F5686 Type : RAID Status : Online Path : 0 Target : 0 LUN ID : 0 Location Path : PCIROOT(0)#PCI(1F02)#RAID(P00T00L00) Current Read-only State : No Read-only : No Boot Disk : Yes Pagefile Disk : Yes Hibernation File Disk : No Crashdump Disk : Yes Clustered Disk : No Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 1 NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 500 GB Healthy Boot Volume 3 D NTFS Partition 500 GB Healthy Volume 4 E NTFS Partition 862 GB Healthy 参看: https://thestarman.pcministry.com/asm/mbr/index.html https://thestarman.pcministry.com/asm/mbr/GPT.htm