Skip to content

Instantly share code, notes, and snippets.

@vibrolax
Created December 6, 2025 19:16
Show Gist options
  • Select an option

  • Save vibrolax/21c191923f3c6366a46adcf587f525e1 to your computer and use it in GitHub Desktop.

Select an option

Save vibrolax/21c191923f3c6366a46adcf587f525e1 to your computer and use it in GitHub Desktop.
Repair boot failures (e.g. INACCESSIBLE_BOOT_DEVICE) for Windows 10 or 11 installation moved or cloned from internal SSD to external USB SSD

Boot Windows 10 or 11 system disk cloned from internal SSD to external SSD

Goals

  • Boot Windows 10 or 11 GPT system disk/SSD moved or cloned onto external USB adapter on a UEFI PC.
  • Use only tools present on the Windows install/recovery USB

Problem

The Window 10 and 11 boot process fails when the boot volume is moved from an internal disk interface (SATA or NVMe) to a USB attached interface. There are interface-specific configuration elements statically defined in the SYSTEM registry hive and sometimes the BCD (Boot Configuration Database) that lead to boot failures if a Windows system that was installed on an internal NVMe or SATA disk interface is moved or cloned to an SSD on an USB external interface.

This occurs in at least two scenarios:

  • The user upgrades the SSD in a laptop or desktop PC. The user places the new SSD into an external USB-to-NVMe (or SATA) Adapter, and clone the existing Windows 10 or 11 installation onto the external SSD using a free or commercial disk cloning tool. Then the user removes the cloned drive from the external adapter and inserts it into an internal SSD interface (NVMe or SATA). The cloned windows installation will boot without incident.

  • The user takes an old SSD with a Windows 10/11 installation, places it into the external USB adapter and tries to boot it. It fails, often with an Stop Code 0x07B (INACCESSIBLE_BOOT_DEVICE). The Windows Startup Repair procedure on the Install/Recovery USB fails. The user spends several days searching the internet, looking for the magic procedure to fix the SSD's BCD and registry configuration so it will boot again when attached to a USB adapter. They will try the "free-as-in-beer" versions of boot repair tools like Macrium Reflect, EasyBCD, EasyUEFI, EaseUS, etc. And none of these will succeed, either. The publishers of these tools know the answer, but will not tell you that you can fix it for free in 5 minutes from the command line with the Windows install/recovery USB.

Posts on various PC technical forums suggest all kinds of arcane registry copies, key additions, modifications, or bcdedit commands. None of these work.

Solution

It turn out the answer was documented by Marc Bevand in 2020: https://blog.zorinaq.com/boot-win10-over-usb/, as well as other Windows forum postings,

The reason why Windows boot fails is that the USB driver stack is not activated early enough in the boot process to load the kernel from a USB-attached disk.

This can be fixed by changing the value of a single registry key. Boot a Windows Install/Recovery USB, and open a command line. On my particular Windows Install USB, I have to click through language and keyboard selection screens, then choose the Repair my PC option. Then I get another keyboard selection screen, and finally a Choose an option screen. Select Troubleshoot, then Command Prompt.

Change the value of HKLM\SYSTEM\HardwareConfig\{Current}\BootDriverFlags
::
:: F: = Windows partition of the USB SSD 
::
reg load HKLM\TEMP F:\Windows\System32\config\SYSTEM
:: find GUID of current configuration
reg query HKLM\TEMP\HardwareConfig
::
:: LastConfig value will be the GUID of the current configuration
:: If you want to see the values of 15 or so hardware configuration items
::
reg query "HKLM\TEMP\HardwareConfig\{GUID of current configuration}"
::
:: Change the value of BootDriverFlags so that the USB and iSCSI driver stack
:: will be loaded in the early boot process
::
reg add "HKLM\TEMP\HardwareConfig\{GUID of current configuration}" /v BootDriverFlags /t REG_DWORD /d 0x14 /f
::
:: save the registry change
::
reg unload HKLM\TEMP

Explanation

If Windows was originally installed on an internal SATA or NVMe SSD, this registry key will have a value of 0, which means no special boot drivers are loaded.

If Windows was originally installed on a USB-attached SATA or NVMe drive, it will have a value of 0x14. This loads iSCSI and USB drivers early in the boot process.

Additional BCD repair may or may not be required

If Windows boot does not just work after changing the registry key value, rebuild the Windows Boot Configuration Database (BCD) on the ESP/EFI partition.

Rebuild the BCD
::
:: assign the drive letter s to the FAT32 ESP/EFI partition on the USB-attached SSD
::

diskpart
list vol
sel vol {# of FAT32 ESP partition on USB-attached SSD}
assign letter=s
exit

bcdboot f:\Windows /s s: /f UEFI /v

In some cases, the BCD may have other conflicting information that prevents the Windows 10/11 installation from booting. Some symptoms include Windows BSOD with codes like UNMOUNTABLE_BOOT_VOLUME, or similar. My solution is to rebuild the ESP/EFI partition from scratch

Reformat the ESP/EFI partition and recreate the BCD from scratch
diskpart
list vol
sel vol {# of FAT32 ESP partition on USB-attached SSD}
format fs=fat32 quick
assign letter=s
exit
  
bcdboot f:\Windows /s s: /f UEFI /v

Research

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment