Windows 10 Refuses to Boot After SSD Upgrade (XPS 9360)

Solution 1:

This is one of many reasons why 3rd party cloning tools are not recommended.

Windows natively supports imaging of partitions via Dism in Windows ≥ 8 (Windows XP ≤ 7: ImageX) more efficiently than 3rd party cloning tools and without configuration issues:

  • Provided the 3rd party tool accurately re-created the partition structure of the HDD, with the ESP and MSR partitions preceding the OS partition, this is an easy fix:
    1. Boot Windows install media → Once loaded: SHIFT+F10
      1. Verify Partitions: diskpartlis dissel dis Xlis par
        (where X is the disk number of the SSD - likely 1 if HDD is still connected)
      2. Below structure is preferred, but the only required partition order is 2 - 4:
        Partition ###  Type              Size     Offset
        -------------  ----------------  -------  -------
        Partition 1    Recovery          2560 MB  1024 KB
        Partition 2    System             260 MB  2561 MB
        Partition 3    Reserved           128 MB  2821 MB
        Partition 4    Primary            300 GB  2949 MB
        
        Partition 2: System (ESP)
        Partition 3: Reserved: (MSR)
        Partition 4: Primary (OS)
      3. If partitions 2 - 4 are correct: exit
      4. Execute: BootRec /FixMBRBootRec /RebuildBCD → Reboot
        • /RebuildBCD: Select only the Windows OS that exists on the SSD (do not select all), or if no Windows OS is found, that's fine too.
    2. Windows should now load, but if not, power off, remove HDD, then boot from the Windows Install Media again and re-run the commands from 1.4
      • If this doesn't work, it will likely be easier to re-image the HDD using Dism, properly configuring the SSD partition structure. See Configure Partitions and Imaging.


Configure Partitions

  1. Boot Windows Setup Media and open a terminal via SHIFT+F10
  2. diskpart:
    1. # SSD: X
        Lis Dis  →  Sel Dis X  →  Clean  →  Convert Gpt
      
    2. # WinRE: WIM is ~300MB and partition must have 320MB free
      
        Cre Par Pri Offset=1024 Size=665 Id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
        Format Quick Fs=NTFS Label=WinRE
        Gpt Attributes=0x8000000000000001
      
    3. # EFI:
        Cre Par EFI Size=100
        Format Quick Fs=FAT32 Label=EFI
        Assign Letter=Y
      
      # MSR:
        Cre Par Msr Size=16
      
    4. If wanting:
      1. Rest of the disk as the system partition:
        # OS:
          Cre Par Pri Id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
          Format Quick Fs=NTFS Label=System
          Assign Letter=C
        
      2. To create additional partitions after the System partition:
        # OS: Multiply partition size wanted by 1024 (i.e. 200*1024=204800)
        
          Cre Par Pri Size=204800 Id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
          Format Quick Fs=NTFS Label=System
          Assign Letter=C
        
        • Creates 200GB System partition, w/ max size required being ~300GB if storing User Data directories on a partition other than C:\ (recommended)
          (i.e %UserProfile%\Documents, %UserProfile%\Downloads, etc.)


  3. Build EFI filesystem structure:
    # Create EFI directories and enter:
      MkDir "Y:\EFI\Microsoft\Boot"
      Cd /d "Y:\EFI\Microsoft\Boot"
    
    # Create EFI boot structure:
      BootRec /Fixboot
    
      # If Access Denied error occurs:
        BcdBoot X:\Windows /s C: /f UEFI
    
    # Resolve any boot issues:
      BootRec /FixMBR && BootRec /RebuildBCD
    
    • If issues arise, close terminal and proceed through Windows setup, selecting the 4th partition created to install Windows to [2.4]; once setup reaches Installing Features, cancel install

  4. Properly Capture and Apply the System partition from the previous disk, utilizing the commands under Imaging, changing /Compress:Max to /Compress:Fast if saving the captured image to an HDD
    • If saving the image to a mechanical HDD, compression takes significant;y longer, so if wanting to use Max or Recovery compression, it's more efficient to use /Compress:Fast, exporting the image later using Max or Recovery
    • Before applying the WIM, format the System partition [2.4 above] on the SSD:
      Format Quick Fs=NTFS Label=System
      


Imaging

  • Windows has always natively supported imaging of partitions or individual directories.
    • The system partition can only be imaged from WinPE/WinRE, while all other partitions are able to be imaged while booted to Windows.
    • WIMs (Windows IMage) can be captured of an entire partition or individual folders/files, being the most efficient method to use (specify exclusions/exceptions in a WimScript.ini)

  • All WinPE/WinRE WIMs have Dism included within them.
    • WinPE: Windows Preinstallation Environment
      Windows install media (terminal: SHIFT+F10)
    • WinRE: Windows Recovery Environment
      WinPE image containing extra WinPE Optional Components vital to recovery


Commands

WinPE only has 32MB of scratch [temp] space by default, so /ScratchDir is required:

  • Capture an image:
    Dism /Capture-Image /ImageFile:"Z:\Base.wim" /CaptureDir:"C:" /Name:"Windows Backup" /Description:"Base Image 2019.11.18 @ 09:35" /Compress:Max /CheckIntegrity /Verify /NoRpFix /ScratchDir:"Z:\"
    
    OR
    Append an Image:
    Dism /Append-Image /ImageFile:"Z:\Base.wim" /CaptureDir:"C:" /Name:"Windows Backup" /Description:"Base Image 2019.11.18 @ 09:35" /Compress:Max /CheckIntegrity /Verify /NoRpFix /ScratchDir:"Z:\"
    

  • Apply an image:
    Dism /Apply-Image /ImageFile:"Z:\Base.wim" /Index:1 /ApplyDir:"C:" /CheckIntegrity /Verify /NoRpFix /ScratchDir:"Z:\"
    
    • If applying a system image, execute prior to booting:
      BootRec /FixMBR && BootRec /RebuildBCD
      


  • It's impossible for an ESD/WIM to become corrupted
    • Provided imaging commands are always issued with: /CheckIntegrity /Verify

  • ESDs can only be taken of the OS partition
    • /Compress:Recovery is the only compression algorithm available
      • ESD compression ratio is ~33% more efficient than the WIM compression ratio
      • In Windows 10, Microsoft only allows ESDs for Push-Button Reset exported images

  • ESDs/WIMs are smart compression image formats
    • Only changed files are added to an image when a new image is appended to it
      • Newly appended images utilize the same copy of unchanged files already contained within the image from the previous image(s), allowing for an image to remain small in relation to the data contained within


Dism Prerequisites

  1. Create Windows 10 install media → Download tool nowChoose to install on another PC
  2. Create bootable USB → Boot it → Open terminal: SHIFT+F10
  3. Dism commands
    • Capture or Append an image
    • Apply Image
      • Get Image Info prior to applying, ensuring correct index [image] is being applied

  • Custom: Create a WinPE/RE image
    1. Install:
      • Windows ADK (8 ≥ 10) is specific to the version of Windows installed.
        • For Windows 10 ≥ v1809: Windows ADK and WinPE Addon for ADK
        • For Windows 10 ≤ v1803: Windows ADK (Windows PE & Deployment Tools)
    2. Create:
      • Microsoft WinPE Wiki
        • Customize WinPE
        • Customize WinRE
      • Reboot.Pro Wiki
    3. Boot it


Example: /Get-WIMinfo

PS $  ls -File "Z:\WIM"

  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"

  Deploy 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.
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.