AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1749077
Accepted
Rhaenys
Rhaenys
Asked: 2022-10-24 13:25:08 +0800 CST2022-10-24 13:25:08 +0800 CST 2022-10-24 13:25:08 +0800 CST

克隆的 Windows 10 无法启动

  • 772

问题: Windows 10 克隆到同一磁盘/不同 SSD 将无法启动。

原因:我有一个具有以下结构的 M.2 NVMe:

  • 300 MB 恢复分区
  • 100 MB EFI 系统分区
  • 视窗 8.1
  • 未分配空间
  • Windows 10(克隆源)

我想将 Windows 10 安装扩展到左侧,并且只能通过克隆/重新安装来完成。

尝试:我在 Linux pendrive 上启动,并对同一驱动器中未分配空间中的新分区进行了 dd 克隆。然后我使用 Windows 恢复模式为新分区创建一个条目。

启动不了,黑屏。尝试 bootrec、bcdboot 复制、删除和重建一切都不起作用。我试图删除指向源 Windows 10 的条目并重命名其 Windows 文件夹,以便只有克隆保留在引导中,但它也没有帮助。

然后我尝试将源克隆到不同的 SSD,新的 EFI 分区仅指向该新的 Windows 10 克隆,还从 NVMe 中删除了 EFI 分区,因此只有一个可能的 EFI 系统分区可以启动,但它仍然没有不行,这次让我蓝屏。

我知道此时我应该移除 NVMe,但它需要将整台计算机拆开,因为它位于主板底部的一个非常紧凑的 mini-itx 机箱中。

可取之处在于撤消 bcd 更改非常简单,因此原始 8.1 和 10 安装启动正常。

问题:我怀疑这是 Windows 到处蔓延并感到困惑的情况之一,阻止自己修复任何问题或创建正确的条目,直到它无法访问它不应该首先接触的安装。

有没有办法让源 Windows 10 安装对恢复模式/克隆安装不可见,而无需物理移除磁盘或删除分区?只有在确定克隆有效时,我才想删除源。

更新 1

事实证明,克隆的 Windows 10 的问题不在于 bcd,或者不在于它本身。尝试以安全模式启动它会让我到达登录屏幕(!!!)。然后事情变得很奇怪。

  • 尝试登录让我收到Sihost.exe的“未知硬错误” 。光标不会停止闪烁和旋转。Ctrl+Shift+Esc 调出任务管理器,从那里我可以打开 cmd、资源管理器等。

  • 查看事件查看器日志会发现“DCOM 出现错误“1084”尝试使用参数“不可用”启动服务ShellHWDetection以运行服务器”错误的无尽列表,我怀疑这是闪烁光标的原因.

  • Sfc 和 dism /online 没有发现要修复的错误。chkdsk 也没有。

  • 另一方面,正常启动会导致屏幕甚至不显示登录屏幕,对尝试的所有快捷方式(Crtl+Shift+Esc、Win+P、Win+L、Win+Ctrl+Shift+B , Crtl+Alt+Del),在右键单击时不会显示上下文菜单,并且通常会吃掉光标(直到移动它才可见,并且在第二次空闲后消失,根本没有旋转图标)。

Ps:在 gparted 之前,我还尝试在新分区中进行全新安装,然后在其上克隆源 Win 10。没有用,并告诉我这与 BCD 无关。

hard-drive uefi
  • 1 1 个回答
  • 49 Views

1 个回答

  • Voted
  1. Best Answer
    Rhaenys
    2022-10-26T08:09:11+08:002022-10-26T08:09:11+08:00

    克隆无法正常启动,因为它的注册表项指向旧分区。

    自从我上次克隆 Windows(到不同的驱动器)以来已经有好几年了,但如果我没记错的话,克隆的 Windows 能够在第一次启动时自行纠正。当您将系统克隆到同一驱动器上的另一个分区时不会发生这种情况,因为它仍然可以看到旧分区,原始字母和所有内容,因此克隆没有理由认为它无法访问这些文件,直到它不能并陷入错误循环。

    了解正在发生的事情使这是一个非常可解决的问题!

    要在同一驱动器上获得有效的 Windows 克隆,您需要:

    • 带有 Ubuntu 的 USB 驱动器
    • 工作恢复环境 (RE) 分区或带有使用 Windows Media Creation Tool(首选)创建的 Windows 映像的 USB 驱动器

    如果需要,互联网上有很多关于如何准备这些 USB 的指南。

    本指南涵盖 GPT/EFI 引导,示例案例包含一个 Windows 8.1 安装和一个将被克隆的 Windows 10 安装。我从来没有见过任何关于克隆到同一个驱动器的指南(他们都告诉你用源删除驱动器)因此这个解决方案到目前为止已经由一个 (01) 人测试过,你好 _o/,所以继续警告。

    问题中问题的确切解决方案在此答案的末尾。


    如何在双启动 EFI 系统中将 Windows 10 克隆到同一磁盘上的另一个分区

    克隆系统的准备工作

    1. (可选,但不是一个坏主意)在继续之前更新您的 Windows 并创建系统还原点。

    2. (可选的安全措施)检查您的注册表项备份在\Windows\System32\config\RegBack. 此文件夹应包含 5 个文件:DEFAULT、SAM、SECURITY、SOFTWARE 和 SYSTEM,但从 Windows 10 版本 1803 开始​​,这不再自动完成。查看这篇文章了解详情。

      如果它是空的或具有零字节的文件,您将需要运行 Windows 任务或通过使用 RE 中的命令提示符复制它们或在登录不同系统时手动备份它们。当我登录另一个系统时,我只是借此机会复制了它们。

    3. 关闭休眠。您要确保在复制 Windows 10 克隆源时完全关闭它。

    4. 确保您的所有操作系统都在正常启动。

      (可选的安全措施)在启动之前备份 BCD 文件,因为您的启动可能会在此过程中被破坏。您可能会重建它们而不是使用备份,但拥有它们并没有什么坏处。每个 Windows 安装都将在\Windows\System32\Boot.

      在磁盘上的隐藏 EFI 分区中也有实际的引导文件。它通常为 100 MB,将被标识为“ EFI 系统分区”。您需要使用来自 RE/不使用相同引导的不同系统的提升命令提示符来执行此操作。

    首先,您将使用磁盘部分分配一个字母。有一个关于如何在指南中进一步说明的解释。然后你将使用xcopy:

    xcopy S:\ D:\EFI_Boot_BK /s /e
    

    S:\EFI 分区在哪里,D:\EFI_Boot_BK是备份目的地。

    xcopy 使用


    克隆 Windows 10 系统

    在 Ubuntu 中克隆

    1. 从 Ubuntu USB 驱动器启动并选择“Try Ubuntu”。
    2. 打开Gparted. 导航到包含克隆源的驱动器,格式化将放置克隆的新分区(如果尚未格式化),并记下包含克隆源和目标的分区的名称。
    3. 打开一个Terminal.

    键入以下命令将 Windows 10 克隆到新分区:

    sudo dd if=/dev/SOURCE of=/dev/TARGET status=progress bs=64K
    

    bs是块大小(64k 是一个不错的值),status=progress将显示一条带有克隆进度的消息。

    SOURCE是您正在复制的 Windows 的分区,TARGET也是您放置它的位置。克隆前仔细检查分区名称。此过程无法撤消;克隆到错误的目标分区将覆盖其数据。

    我的系统中的示例:

    在 Ubuntu 中克隆 Windows 10 (忽略分区混乱和 Fresh Win 10,他们被用来测试结果证明是坏建议)

    完成后,克隆将具有与源系统相同的标签。您可以使用Gparted将它们重命名为其他名称。在这种情况下,我将源重命名为“Win 10 (BK)”。应用更改。

    使用dd的更详细解释:

    • 使用 dd 克隆磁盘

    使用 RE cmd 使用 DISKPART 和引导命令修复引导

    1. 重新启动到原始窗口之一并打开提升的命令提示符,进入 RE 或 Windows 10 USB 安装驱动器。我更喜欢后者以避免意外触发自动修复,此时这可能会使您之前工作的 Windows 安装的启动混乱。

      如果使用 USB 工具,请选择Next然后Repair your computer访问恢复屏幕,然后选择Troubleshoot > Command Prompt。在 RE 中,它类似于Troubleshoot > Advanced options > Command Prompt.

    2. 使用 DISKPART 为 EFI 分区分配一个字母。借此机会记下分配给 Windows 分区的字母。

    在我的例子中,使用的命令是:

    > diskpart
    > list disk
    (figure out which disk contains your installations from their details)
    > sel disk 2
    (my windows disk)
    > detail disk
    (get details to find out installation letters and find boot partition)
    >sel vol 9
    (my boot partition's volume number)
    > assign letter=S
    (you can assign whatever free letter you want)
    > exit
    

    使用 DISKPART 为 EFI 引导分配字母

    1. 更正克隆分区的主引导代码。

    类型:

    bootsect /nt60 C: /force
    

    C:是这里分配给克隆分区的字母。替换为您的任何字母。

    1. (可选的安全措施)。键入bcdedit并拍摄所有条目的照片,以便以后完全重新创建标志。Windows 在重建条目方面做得很好,但可能会分配错误的语言环境或遗漏一些原始标志,这不是问题,但并不理想。

    2. 为克隆的分区重新创建 BCD 条目。此过程类似于bootrec /rebuildbcd,其优点是即使在 /rebuildbcd 因“找不到指定路径”而失败的情况下也能重新创建条目。

    类型:

    bcdboot C:\Windows /s S: /f UEFI
    

    C:\Windows是用于重建此条目的源;在这种情况下克隆的分区。S:是目的地,EFI 引导分区。此过程应仅重建克隆条目。/f UEFI在这种情况下应该使用 GTP、EFI 磁盘。

    1. (可能是可选的)现在,我遇到的几乎所有修复 BCD 问题的指南都建议使用以下命令。然而,它们似乎适用于 MBR 引导,而不是 EFI。它们不会损害 EFI 引导系统,但可能与在您的肩膀上撒盐一样有用。为好运而做!

    类型:

    > bootrec /fixmbr
    > bootrec /fixboot
    (don't worry if it says "Access is denied")
    > bootrec /rebuildbcd
    (It'll probably return 0 installations found ¯\_(ツ)_/¯ )
    
    1. 键入bcdedit以确认所有 Windows 安装都有Windows 引导加载程序条目。您可以使用bcdedit /set {identifer} flag flagvalue来调整或添加标志到条目。这是更改源和克隆窗口的描述的好机会,因此您可以在启动时轻松区分它们。

      克隆的窗口现在可能是默认操作系统。我喜欢将其更改为安全、可启动的窗口以防万一。这可以在引导时在操作系统选择屏幕中完成,或者现在使用bcdedit /default {identifier}. 完成后可以使用shutdown -r重新启动。

      要复制条目标识符(或任何其他值),请通过单击并拖动光标并右键单击来突出显示它。您可以再次右键单击粘贴。它看起来像这样:

    复制并粘贴到 CMD 中

    提示:您现在有可能意外触发了自动修复,并且您的原始 Windows 分区之一无法启动,您无法使用键盘选择操作系统或其他一些奇怪的东西。您可以使用bootsect /nt60 all /force修复所有分区扇区,然后bcdboot将 BCD 从受影响的安装复制到引导分区的过程。

    Misc useful boot and BCD resources:

    • How to Repair EFI/GPT Bootloader on Windows 10 or 11? (How to recreate BCD from scratch at the end oif article in case the partial fixes above don't work)
    • BCDedit /set flags (MS article detailing parameters)
    • Boot error loop -> /rebuildbcd error and cant set active volume (SE, DISM repair from Windows USB image source)
    • How to Fix Startup Repair in Windows 10 (Youtube, bootsect example)
    • How to Fix Automatic Repair Loop in Windows 10 - Startup Repair Couldn't Repair Your PC (Youtube, how to use registry keys backup)

    Fixing the Cloned Windows 10 black screen / sihost.exe Unknown Hard Error

    This is the step I was stuck on when I posted the question.

    By now you're not supposed to try to log into the cloned Windows yet. If you do, you won't be able to reach the login page. You'll see a black screen with a cursor that keeps disappearing when you stop moving it. Windows won't react to any shortcuts you use. I don't advise to try it, it's easier to confirm and fix the issue straight away by doing the following:

    1. You can use bcdedit /set {identifier} safebootalternateshell Yes to set the clone to safe mode or boot into one of your original Windows installations and use Win+R to bring the Run box up, typing msconfig to change settings from there.

    配置文件

    Select the clone and check Safe boot. If you're on the source Windows 10 install, you'll be able to see the letter the clone assumed when you're using the clone installation itself besides the letter assigned to the source Windows. Take note of them.

    You can also use that screen to set a different Windows installation as default if you didn't already.

    1. Boot into the cloned Windows 10. You should be able to reach the login screen without issues. Once you log in you'll see something like this (apologies for the terrible photo!):

    登录时出现硬错误

    Wait for the screen to turn black. You cursor should be blinking and loading like crazy, the error box will remain there.

    1. Press "Ok" on the box. Use Ctrl+Shit+Esc to open the Task Manager. Go to File > Run new task and type cmd, checking "Create this task with administrative privileges" if given the option.

      You'll have to type quickly because the error state in which Windows is causes all inputs to keep losing focus. Minimize the task manager, that will mitigate the issue of losing focus when typing on the prompt at least.

    2. (optional) You can further confirm your issue is exactly like mine by checking the Event Viewer and Disk Management.

      To check the events type eventvwr and go to Windows Logs > System. You should see multiple DistributedCOM 10005 errors popping at every second, saying things like "DCOM got error "1084" attempting to start the service ShellHWDetection with arguments "Unavailable" in order to run the server".

      To confirm the clone is accessing the source windows partition type diskmgmt in the cmd. You'll see Page File and possibly other flags that shouldn't be there on the source partition. The clone will be the boot system but will lack a page file.

      That means the clone knows it's in a different partition with a letter other than the one of the source system, it's the current booted system, its registry is being used, but those keys still point to the source system. It's presumably denying access, causing the black screen and all those errors.

      To fix it you'll need change the letter of the old system, and assign its original letter to the clone, while being logged into the clone. DO NOT DO IT THROUGH DISK MANAGEMENT. It'd try to correct the registry (which will be already correct if the letters are switched) and break everything. You'd have to reclone the system.

      In this example the original source Windows 10, in the partition Win 10 (BK) has the letter C:. The clone has the letter F:. You want the source to have any other letter and the clone to be C:.

    3. To correct the letters minimize everything, return to the cmd and type regedit to open the Registry Editor. Go to HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices. You should see something like this:

    注册表分区字母

    Return to the cmd and type \DosDevices\(ANY LETTER NOT IN USE):. Example: \DosDevices\X:. Highlight it then right click to copy. Don't press Enter. The reason you're doing it is because the prompt loses focus fewer times that any other windows. Trying to type that directly in the registry key is hell, but pasting is easy!

    1. 返回注册表窗口,右键单击带有源 Windows 10 安装分区字母的条目。就我而言,这是 C:。在cmd中选择Rename并粘贴刚刚准备好的字符串。

    2. 重复 cmd 技巧,现在输入您希望克隆分区的字母,这应该是原始系统所具有的并且您刚刚释放的字母。就我而言,这是\DosDevices\C:. 复制、右键单击并重命名指向克隆系统的键 ( \DosDevices\F:),粘贴新值。

    3. 恭喜你,你做到了!您可以打开msconfig、禁用安全启动并重新启动到克隆系统。它现在应该可以正常运行了。

    有关通过 regedit 更改引导驱动器号的 MS 文章:

    • 在 Windows 中恢复系统或启动盘符
    • 0

相关问题

  • 可以读取硬盘驱动器并专门写入 RAM 的系统?

  • 5 年后我应该更换/升级我的硬盘吗?

  • 我应该对用于存储的辅助(非操作系统)SSD 进行分区吗?[关闭]

  • 在 Windows 10 中运行 CrystalDiskMark 会导致 BSOD

  • “写悬崖”现象是否只发生在SSD盘上?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve