将 Windows 10 安装移动到另一个驱动器

Ieu*_*uan 1 windows boot ssd sata clone

有很多这样的问题,但鉴于具体情况,我将这个问题添加为一个新问题,因为有一些具体问题需要解决。

使我走到这一步的步骤:

  1. 我有一台带有 SATA SSD 的 PC,这个 SSD 开始出现问题
  2. 我放入了一个 m.2 SSD 并在其上安装了 Windows 10,但未移动引导加载程序/记录,旧 SSD 保留在系统内
  3. 我的 SATA SSD 彻底崩溃了,这使我的系统无法访问。
  4. 我换了一个不同的 SSD 并对 m.2 进行了错误检查,这很好。Windows 的恢复终端不会让我在 m.2 上创建新的引导记录,虽然它仍然识别安装它不会让我启动它,只是在新的 SATA SSD 上进行全新/空白安装。

因此,我订购了一个新的 m.2 SSD 和一个 m.2 转 SATA 机箱(这样我就可以从旧的 m.2 上拉出数据,因为我的主板只有一个 m.2 插槽)。

我想将我的 Windows 安装从旧的 m.2 移动到新的 m.2。新 SSD 比旧 SSD (128GB) 大 (1TB),但我无法启动旧系统,只能访问其文件。我还特别想删除任何其他驱动器,但是 m.2 上没有引导记录,因此在此过程中需要在新 SSD 上创建。

我可以 1:1 克隆驱动器,只要我仍然可以创建引导记录并将分区大小调整为完整的 SSD 大小。仅修复旧的 m.2 SSD 不是一种选择,因为它也会降级(其上的缓存已损坏)。

不知何故,我需要将文件从旧的 SSD 克隆到新的 SSD 并在新的 SSD 上创建引导记录,而无需访问旧系统。

在 USB 驱动器上运行的实时环境中,是否有流程或软件可以帮助我做到这一点?

JW0*_*914 5

对于 Windows,第 3 方克隆工具并不是对分区进行映像的有效方法。

  • Windows一直原生支持分区或单个目录的映像。
    • 系统分区只能从 WinPE/WinRE 进行映像,而所有其他分区在启动到 Windows 时都可以进行映像。
    • 可以捕获整个分区或单个文件夹/文件的WIM W indows IM时代)
      创建一个WimScript.ini配置文件来指定排除或例外。

  • 所有 WinPE/WinRE WIMDISM包含在其中。
    • WinPE的: DOWS P重新安装Ë nvironment
      • 例如 Windows 安装启动媒体(SHIFT+F10访问终端)
    • WinRE中: DOWS [R ecovery Ë nvironment
      • WinRE 是一个 WinPE 映像,其中包含对恢复至关重要的额外WinPE 可选组件

配置分区

  1. 下载Windows 媒体创建工具
    • 将安装媒体保存为 ISO 并使用Rufus创建可启动的 USB
  2. 启动 Windows Install USB 并通过+打开终端SHIFTF10
  3. 配置驱动器的分区或使用此脚本 ( diskpart /s CreatePartitions.txt)
    1. diskpart> lis dis> sel dis #>clean
      • 欧洲足联: convert gpt
    2. 创建 WinRE 分区:
      1. BIOS: cre par pri offset=1024 size=665 id=27
      2. 欧洲足联: cre par pri offset=1024 size=665 id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
      3. format quick fs=ntfs label=WinRE
        • WinRE 分区必须有 320MB 可用空间(WinRE.wim大小约为 300MB)
      4. 欧洲足联: gpt attributes=0x8000000000000001
    3. 创建引导分区:
      1. BIOS:
        1. cre par pri size=100
        2. format quick fs=ntfs label=Boot
        3. active
      2. 欧洲足联:
        1. cre par efi size=100
        2. format quick fs=fat32 label=EFI
        3. cre par msr size=16
    4. 如果想要:
      1. 磁盘的其余部分作为系统分区:
        1. BIOS: cre par pri
          UEFI: cre par pri id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        2. format quick fs=ntfs label=System
      2. 在系统分区之后创建额外的分区
        1. BIOS: cre par pri size=204800
          UEFI: cre par pri size=204800 id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
          • 创建 200GB 系统分区,如果将用户数据目录存储在C:\(推荐)以外的分区
            (即、 等)%UserProfile%\Documents,则需要的最大大小为 ~300GB%UserProfile%\Downloads
          • 乘以 1024 所需的分区大小(即200*1024=204800
        2. format quick fs=ntfs label=System
      3. DiskPart通过以下方式退出:exit
  4. BIOS:继续进行成像
    UEFI:
    1. 关闭终端并继续进行 Windows 设置
    2. 选择创建的分区以将 Windows 安装到(#3.4)
    3. 一旦安装程序到达“安装功能”步骤,取消安装
      • 安装程序可能会更快取消,但是,我不确定它在哪一点用启动文件配置 EFI 分区,这是您使用 Windows 安装程序的唯一原因,因为 EFI 分区不能由Windows 10 上的用户。
    4. 在关闭设置 GUI 之前,否则重新启动以安装 USB,再次打开终端以获取下一部分中的映像命令。
      • 在将映像应用到新驱动器上的系统分区之前,再次格式化分区DiskPart以确保它没有任何安装程序文件。

成像

默认情况下,WinPE 只有 32MB 的临时 [临时] 空间,因此/ScratchDir是必需的

  1. 捕获图像:
    DISM /Capture-Image /ImageFile:"Z:\Base.wim" /CaptureDir:"C:" /Name:"Windows Backup" /Description:"Base Image 2020.04.22 @ 10:05" /Compress:Max /CheckIntegrity /Verify /NoRpFix /ScratchDir:"Z:\"
    
    Run Code Online (Sandbox Code Playgroud) 附加图像
    • 更改/Compress:Max/Compress:Fast,如果不保存拍摄的图像的SSD
  2. 应用图像
    DISM /Apply-Image /ImageFile:"Z:\Base.wim" /Index:1 /ApplyDir:"C:" /CheckIntegrity /Verify /NoRpFix /ScratchDir:"Z:\"
    
    Run Code Online (Sandbox Code Playgroud)

笔记:

  • 这是不可能的防静电/ WIM映像被损坏
    • 提供的成像命令总是/CheckIntegrity&发出/Verify

  • ESD 只能取自系统分区
    • /Compress:Recovery 是唯一可用的压缩算法。
      • ESD 压缩比比 WIM 压缩比高约 33%。
      • 在 Windows 10 中,Microsoft 仅允许对 Push-Button Reset 导出的图像进行 ESD

  • ESDs/WIMs 是智能压缩图像格式
    • 将新图像附加到图像时,仅将更改的文件添加到图像
      • 新添加的图像使用先前图像中已包含的未更改文件的相同副本。
        • 这允许图像相对于其中包含的数据保持较小。


例子: /Get-WIMinfo

PS $  ls -file

  Directory: Z:\WIM

    Mode                LastWriteTime            Length  Name
    ----                -------------            ------  ----
    -a----        2018.12.24 03:34:13   95,019,530,773B  Base.wim
    -a----        2016.06.14 22:32:36              568B  DISM.cmd
    -a----        2016.05.17 05:36:10               97B  wimscript.ini

PS $  dism /get-wiminfo /wimfile:Base.wim

  Deployment Image Servicing and Management tool
  Version: 10.0.18362.1

    Details for image : Base.wim

    Index : 1
      Name : Alienware 18: Windows 10
      Description : v1803: Base (Drivers Only)
      Size : 22,710,283,446 bytes

    Index : 2
      Name : Alienware 18: Windows 10
      Description : v1803: Software Installed (No Customizations)
      Size : 45,591,850,754 bytes

    Index : 3
      Name : Alienware 18: Windows 10
      Description : v1803: Software Installed (Customized)
      Size : 94,958,267,312 bytes

    Index : 4
      Name : Alienware 18: Windows 10
      Description : v1803: Software Group 1 Installed (Customized)
      Size : 101,588,267,910 bytes

    Index : 5
      Name : Alienware 18: Windows 10
      Description : v1803: Software Group 2 Installed (Customized)
      Size : 101,905,314,237 bytes

    Index : 6
      Name : Alienware 18: Windows 10
      Description : v1809: Updated Applications
      Size : 114,959,954,040 bytes

  The operation completed successfully.
Run Code Online (Sandbox Code Playgroud)
PS $  dism /get-wiminfo /wimfile:Base.wim /index:1

  Deployment Image Servicing and Management tool
  Version: 10.0.18362.1

    Details for image : Base.wim

      Index : 1
      Name : Alienware 18: Windows 10
      Description : v1803: Base (Drivers Only)
      Size : 22,710,283,446 bytes
      WIM Bootable : No
      Architecture : x64
      Hal : acpiapic
      Version : 10.0.17134
      ServicePack Build : 1
      ServicePack Level : 1
      Edition : Professional
      Installation : Client
      ProductType : WinNT
      ProductSuite : Terminal Server
      System Root : WINDOWS
      Directories : 24288
      Files : 112665
      Created : 2018.05.05 - 13:56:47
      Modified : 2018.05.05 - 13:56:47
      Languages :
              en-US (Default)

  The operation completed successfully.


PS $  dism /get-wiminfo /wimfile:Base.wim /index:2

  Deployment Image Servicing and Management tool
  Version: 10.0.18362.1

    Details for image : Base.wim

      Index : 2
      Name : Alienware 18: Windows 10
      Description : v1803: Software Installed (No Customizations)
      Size : 45,591,850,754 bytes
      WIM Bootable : No
      Architecture : x64
      Hal : acpiapic
      Version : 10.0.17134
      ServicePack Build : 1
      ServicePack Level : 1
      Edition : Professional
      Installation : Client
      ProductType : WinNT
      ProductSuite : Terminal Server
      System Root : WINDOWS
      Directories : 45803
      Files : 203058
      Created : 2018.05.06 - 01:55:47
      Modified : 2018.05.06 - 01:55:48
      Languages :
              en-US (Default)

  The operation completed successfully.


PS $  dism /get-wiminfo /wimfile:Base.wim /index:3

  Deployment Image Servicing and Management tool
  Version: 10.0.18362.1

    Details for image : Base.wim

      Index : 3
      Name : Alienware 18: Windows 10
      Description : v1803: Software Installed (Customized)
      Size : 94,958,267,312 bytes
      WIM Bootable : No
      Architecture : x64
      Hal : acpiapic
      Version : 10.0.17134
      ServicePack Build : 1
      ServicePack Level : 81
      Edition : Professional
      Installation : Client
      ProductType : WinNT
      ProductSuite : Terminal Server
      System Root : WINDOWS
      Directories : 62409
      Files : 350446
      Created : 2018.06.01 - 19:09:51
      Modified : 2018.06.19 - 21:26:18
      Languages :
              en-US (Default)

  The operation completed successfully.


PS $  dism /get-wiminfo /wimfile:Base.wim /index:4

  Deployment Image Servicing and Management tool
  Version: 10.0.18362.1

    Details for image : Base.wim

      Index : 4
      Name : Alienware 18: Windows 10
      Description : v1803: Software Group 1 Installed (Customized)
      Size : 101,588,267,910 bytes
      WIM Bootable : No
      Architecture : x64
      Hal : acpiapic
      Version : 10.0.17134
      ServicePack Build : 1
      ServicePack Level : 81
      Edition : Professional
      Installation : Client
      ProductType : WinNT
      ProductSuite : Terminal Server
      System Root : WINDOWS
      Directories : 61908
      Files : 346074
      Created : 2018.06.08 - 21:54:02
      Modified : 2018.06.19 - 21:26:18
      Languages :
              en-US (Default)

  The operation completed successfully.


PS $  dism /get-wiminfo /wimfile:Base.wim /index:5

  Deployment Image Servicing and Management tool
  Version: 10.0.18362.1

    Details for image : Base.wim

      Index : 5
      Name : Alienware 18: Windows 10
      Description : v1803: Software Group 2 Installed (Customized)
      Size : 101,905,314,237 bytes
      WIM Bootable : No
      Architecture : x64
      Hal : acpiapic
      Version : 10.0.17134
      ServicePack Build : 1
      ServicePack Level : 81
      Edition : Professional
      Installation : Client
      ProductType : WinNT
      ProductSuite : Terminal Server
      System Root : WINDOWS
      Directories : 76113
      Files : 423408
      Created : 2018.06.09 - 20:38:36
      Modified : 2018.06.19 - 21:26:18
      Languages :
              en-US (Default)

  The operation completed successfully.


PS $  dism /get-wiminfo /wimfile:Base.wim /index:6

  Deployment Image Servicing and Management tool
  Version: 10.0.18362.1

    Details for image : Base.wim

      Index : 6
      Name : Alienware 18: Windows 10
      Description : v1809: Updated Applications
      Size : 114,959,954,040 bytes
      WIM Bootable : No
      Architecture : x64
      Hal : acpiapic
      Version : 10.0.17763
      ServicePack Build : 195
      ServicePack Level : 0
      Edition : Professional
      Installation : Client
      ProductType : WinNT
      ProductSuite : Terminal Server
      System Root : WINDOWS
      Directories : 87659
      Files : 452028
      Created : 2018.12.24 - 04:27:13
      Modified : 2018.12.24 - 04:27:15
      Languages :
              en-US (Default)

  The operation completed successfully.
Run Code Online (Sandbox Code Playgroud)

  • @Ieuan 在终端中发出的命令格式错误_(重复两次)_。结果图像最终只有 7 个文件的唯一方法是捕获了不正确的驱动器 - 请张贴 `lis vol` 的 `diskpart` 输出的图片 (2认同)