Can I boot Windows from an HDD via USB? inaccessible_boot_device

Page 3 of 3 FirstFirst 123

  1. Posts : 13
    Windows 10
       #21

    AFAIK There are two ways, the easiest one is to run it on your actual system before cloning it: purists say that the boot time is lengthened (theoretically) due to the fact that the USB 2.0 and 3.0 drivers are loaded "unnecessarily", but if even it happens you won't notice.

    Second way is to add the registry key to the already cloned system, but since it doesn't boot (!) you have first to mount the related registry hive and then add the key, but you will have to do it from Winpe (or even another windows installation, such as a VHD).


    Edit to add: of course the second way needs to change the above command, or better to add an appropriate ".reg" file to the loaded registry hive.
      My Computer


  2. Posts : 28
    win 10
       #22

    Thanks. I found another thread where SIM shows how to import the usb hive and edit locally, then save. Don't have the link handy now but I'll look for it.
      My Computer


  3. Posts : 4,597
    several
       #23

    tyeeman said:
    Does anyone have the command to change this using a batch file? I've cloned my ssd to USB and have been trying to figure out why it won't boot and this setting must be it.
    Been doing it for years with win7
    original idea by cdob
    https://learn.microsoft.com/en-us/pr...ectedfrom=MSDN
    PollBootPartitionTimeout:
    To ensure that the system can properly boot from a flash device, this setting changes the PollBootPartitionTimeout registry key value. This registry key is used to control how long the kernel waits for PnP to surface the boot disk before it stops with bugcheck code 0x7B

    BootDriverFlags specifies which types of drivers are loaded during boot:
    adjust the path in this line
    set System_Root=Path to target SystemRoot folder on usb stick e.g. e:\Windows

    For win7
    Code:
    @echo off
    setlocal EnableExtensions EnableDelayedExpansion
    pushd %~dp0
    
    set System_Root=Path to target SystemRoot folder e.g. e:\Windows
    copy "%System_Root%\system32\config\system" "%System_Root%\system32\config\system_%random%.sav"
    reg.exe load HKLM\loaded_SYSTEM "%System_Root%\system32\config\system"
    
    set ControlSetDefault=
    call :setReg Default
    call :setReg LastKnownGood
    
    reg.exe unload HKLM\loaded_SYSTEM
    popd
    
    goto :eof
    
    :setReg
     set ControlSet=001
     reg.exe query "HKLM\loaded_SYSTEM\Select" /v "%1" >nul 2>&1 && (
      for /f "skip=2 tokens=3" %%a in ('reg.exe query "HKLM\loaded_SYSTEM\Select" /v "%1"') do set /a ControlSet=%%a
      set ControlSet=000!ControlSet!
     )
     set ControlSetNNN=ControlSet%ControlSet:~-3%
     if %ControlSetDefault%.==%ControlSetNNN%. goto :eof
     echo. &echo ControlSet "%ControlSetNNN%" used.
    
     set Services=HKLM\loaded_SYSTEM\%ControlSetNNN%\Services
     set Control=HKLM\loaded_SYSTEM\%ControlSetNNN%\Control
    
     reg.exe add %Control%\PnP /f /v PollBootPartitionTimeout /t REG_DWORD /d 30000
     reg.exe add %Control% /f /v BootDriverFlags /t REG_DWORD /d 0x6
    
     set ControlSetDefault=%ControlSetNNN%
    goto :eof


    for win10-11 hardwareconfig
    adjust the path in this line
    set System_Root=Path to target SystemRoot folder on usb stick e.g. e:\Windows
    Code:
    @echo off
    set System_Root=Path to target SystemRoot on usb stick e.g. e:\Windows
    copy "%System_Root%\system32\config\system" "%System_Root%\system32\config\system_%random%.sav"
    reg.exe load HKLM\loaded_SYSTEM "%System_Root%\system32\config\system"
    for /f "tokens=2* delims= " %%i in ('reg query HKLM\loaded_SYSTEM\HardwareConfig /v LastConfig 2^>nul^|findstr /i LastConfig') do set "guid=%%j"
    reg add HKLM\loaded_SYSTEM\HardwareConfig\%guid% /v BootDriverFlags /t reg_dword /d 0x14 /f
    reg add HKLM\loaded_SYSTEM\ControlSet001\Control /v PortableOperatingSystem /t reg_dword /d 1 /f
    reg.exe unload HKLM\loaded_SYSTEM
    普通系统切换为WTG的方法 . GitHub
    Last edited by SIW2; 1 Week Ago at 04:02.
      My Computer


  4. Posts : 13
    Windows 10
       #24

    SIW2 said:
    Been doing it for years with win7
    With due respect I believe that Windows 10 does not require the "treatment" that indeed was needed under Windows 7.

    My opinion, for what it's worth, is that only the "BootDriverFlags" value editing is necessary for Windows 10 USB booting.

    That it can then be performed in various ways it's a completely different matter.
      My Computer


  5. Posts : 28
    win 10
       #25

    Nice, thanks guys! One question - If my USB is a clone of my C disk with all the usual 4 UEFI partitions I believe it won't boot until I modify the BCD because the clone would be using the C disk partition info which is incorrect. I think this would fix it -

    diskpart
    list vol (find fat32 100MB system partition)
    select vol 2 (assuming that's it )
    assign letter=V (give it a letter)
    exit
    bcdboot f:\windows /s V: /f UEFI (assuming F is my USB cloned drive)

    - - - Updated - - -

    OK, just tried it using @SIW2 tutorial here

    I only changed "BootDriverFlags" in the cloned registry and it booted fine. My USB boot disk was actually in a hub also so I didn't have to move it to the main chassis port. I will try the script next.

    Also I didn't do what I said should be done above using diskpart/bcdboot. How come it worked ok? What I did see was that my normal C: was not on that Blue/White boot menu, the USB disk had taken it's place. Maybe if I add the diskpart/bcdboot commands above it will show on the boot menu.
    Last edited by tyeeman; 1 Week Ago at 01:05.
      My Computer


  6. Posts : 13
    Windows 10
       #26

    tyeeman said:
    I only changed "BootDriverFlags" in the cloned registry and it booted fine.
    Glad to hear about that.
    tyeeman said:
    If my USB is a clone of my C disk with all the usual 4 UEFI partitions
    Please note that you don't need at all 4 partitions on your virtual disk in order to boot it, even if you want to encrypt it running BitLocker.
    You just need the single partition of your Windows, that's what Disk Management describes as "Basic Data Partition", in addition to the inevitable than inaccessible MSR one, since the whole boot process will take place in the first partition of the first disk (in your case), that's in the hidden ESP (EFI System Partition) one.

    Can I boot Windows from an HDD via USB? inaccessible_boot_device-sshot.png

    From here

    - - - Updated - - -

    tyeeman said:
    I believe it won't boot until I modify the BCD
    Correct.
    tyeeman said:
    What I did see was that my normal C: was not on that Blue/White boot menu, the USB disk had taken it's place. Maybe if I add the diskpart/bcdboot commands above it will show on the boot menu.
    We can't know what you exactly did, but I can suggest to run BOOTICE for BCD editing (and for many other things).
    Running it you can also see an option in order to choose which type of boot manager you want to view.
    Can I boot Windows from an HDD via USB? inaccessible_boot_device-sshot.png
    Last edited by logon; 1 Week Ago at 05:39.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:03.
Find Us




Windows 10 Forums