Jump to content











Photo
* * * * * 2 votes

[Tutorial] Boot Windows 7 from USB hard disk by karyonix


  • Please log in to reply
171 replies to this topic

#1 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    Thailand

Posted 25 September 2009 - 11:40 PM

This tutorial is from 2009. It is now considered obsolete since there exist better ways. (Search for NT 6.x fast installer, BootDriverFlags, PollBootPartitionTimeout.)

 

This tutorial is result of discussion in this thread --> Boot Windows 7 from USB hard disk

Install in SATA disk and move to USB
  • Attach SATA disk to computer
    You can create a new partition and mark it as active partition before boot from Windows 7 DVD
  • Boot from Windows 7 setup DVD (or other media),
    create a partition in SATA (if not already created),
    use diskpart to mark partition as active (if it is not the only partition in the computer),
    install Windows 7
  • Boot from SATA disk into new Windows 7
  • Run cmd as administrator
    reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v DisablePagingExecutive /t REG_DWORD /d 1
    
    
    This setting may help prevents USB drivers code from being paged out.
    Driver's data are not affected by this settings, so ther is still some possibility that USB drivers will fail when in low memory state.
  • Run usbbootfix.bat
  • (optional) Run StorageBootStart.bat . It will set all known disk controller drivers to Start=0.
    Pro: Increase chance of successful boot when move to different machines.
    Con: Increase loading time, slower boot.
  • Shut down Window.
  • a. Disconnect SATA disk and put in USB disk enclosure.
    or
    b. Clone Windows to USB disk.
  • Boot from USB.

Clone Windows 7 from IDE/SATA to USB hard disk
Note : This copy method using xcopy does not create hard links. The clone will use more disk space than source.
Spoiler



Another way to install. This is not preferred way to install, just another possibility.
Install in VHD by using virtual machine (Windows Virtual PC or VirtualBox)
Note : Not all editions of Windows 7 support native-boot VHD.
Only Windows 7 Enterprise and Ultimate (including Release Candidate) support native-boot VHD.
  • Create partition in USB disk (U:), format, make it active partition.
  • Use Disk Management or Diskpart to Create VHD image, size 15GB or more.
  • In Windows Virtual PC folder or VirtualBox, create virtual machine RAM 1GB or more
  • Attach VHD and Windows 7 DVD or ISO to virtual machine
  • Start virtual machine, boot from DVD, install Windows 7
  • Copy usbbootfix.bat to VHD (by network share or mount VHD in host).
  • In virtual machine, run usbbootfix.bat as administrator
  • Shutdown virtual machine.
  • In Disk Management in Windows 7 host, attach VHD.
  • If you just want to use VHD as source for cloning to USB disk, skip the following steps and goto Cloning Windows 7 above.
    If you want to native-boot VHD, adjust BCD entry for native-boot VHD with the following steps.
  • Let's assume USB disk partition is U: and Windows partition in U:\name.vhd is V: in host computer
  • (modified 2009-12-24)
    Copy bootmgr and Boot directory from V:\ to U:\
    Run cmd as administrator in host
    bcdedit /store U:\Boot\BCD /set {default} device partition=V:
    bcdedit /store U:\Boot\BCD /set {default} osdevice partition=V:
    bcdedit /store U:\Boot\BCD /set {default} detecthal on

    Run cmd as administrator in host
    bcdboot V:\Windows /s U:
  • detach VHD from host
  • boot from VHD in USB

Attached Files


  • Nuno Brito likes this

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • Team Reboot
  • 10424 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 26 September 2009 - 12:14 AM

Excellent tutorial!

But getting all these steps completed might take a good while.. :cheers:


Any chances of automating the build with a wb project?

Virtualbox is fairly easy to manage from command line and perhaps even the install procedure could be completely automated as well.

:)

#3 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 26 September 2009 - 02:15 AM

Excellent tutorial, thanks a lot karyonix

#4 spen2

spen2
  • Members
  • 1 posts
  •  
    United Kingdom

Posted 01 October 2009 - 10:12 PM

Really easy to follow tutorial, Many Thanks.

I used the first option 'Install in IDE/SATA disk and move to USB' and then cloned the hard drive image to a usb drive using ghost. Works perfectly, thanks again. :D

#5 OzzyGuY

OzzyGuY
  • Members
  • 4 posts
  •  
    Australia

Posted 09 October 2009 - 06:48 AM

Excellent tutorial mate.
And it works.
Ive been hoping to achieve this for a long time, and now my dreams are reality.
Ive actually booted my Windows 7 drive on 3 different PC's now, all with success.
A Truly "portable" Windows Installation.

Thankyou very much.

#6 ktp

ktp

    Silver Member

  • Advanced user
  • 733 posts

Posted 10 November 2009 - 06:24 PM

I tried this method, and it boots correctly on one laptop, but on another, I get BSOD ! I have to disable the automatic reboot since the blue screen disappears too quickly,.

For information:
Instead of installing on a real computer, I installed Windows 7 under VMware, then I run the usbootfix.bat and shutdown, then I take the disk image with DriveSnapshot (similar to Ghost), then I restore the image to an USB HDD and boot from it.

#7 ktp

ktp

    Silver Member

  • Advanced user
  • 733 posts

Posted 11 November 2009 - 06:46 AM

OK after disabling the automatic reboot, I saw that the BSOD is with the dreaded stop code 0x7B. I am familiar with this, so on the laptop that boots fine, I just applied my great old usb_all.reg that changes important USB-related registry entries (usbehci, usbohci, usbuhci, usbccgp, usbhub, USBSTOR). Afterwards, now Windows 7 boots fine on both laptops from USB HDD !

Note that depending on the hardware, you are asked to reboot once to update the ACPIPIC/ACPIAPIC device (other drivers like network, sound... are already automatically searched and installed). So this is not 100% "portable" as with my current XP booting from USB HDD using usboot from usboot.org.

The method of usb_all.reg applied for Vista too already, so there is nothing new. usbwatcher.exe method seemingly tries to set to right values in registry, and karyonix's method seems to create a planned job that does same thing at initial boot time. I don't know why it does not work in my case.

Anyhow, to be sure, before any reboot, and especially after Windows update or driver update or USB plug-and-play, remember to apply usb_all.reg. This ensures that no BSOD 0x7B is hit on next boot. If ever you still get it, you have to offline change the registries (using RegEditPE or RegistryLoaderPE ) for these USB-related values (in fact the important key is Start which must be set to 0, usually we got BSOD 0x7B because Windows resets it to 3).

Here is usb_all.reg content:
Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbccgp]"DisplayName"="Microsoft USB Generic Parent Driver""Group"="Boot bus extender""ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\  74,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,\  00,69,00,76,00,65,00,72,00,73,00,5c,00,75,00,73,00,62,00,63,00,63,00,67,00,\  70,00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbccgp\Enum]"0"="Root\\LEGACY_USBCCGP\\0000""Count"=dword:00000001"NextInstance"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbehci]"DisplayName"="Microsoft USB 2.0 Enhanced Host Controller Miniport Driver""Group"="Boot bus extender""ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\  52,00,49,00,56,00,45,00,52,00,53,00,5c,00,75,00,73,00,62,00,65,00,68,00,63,\  00,69,00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001"Tag"=dword:00000019[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbehci\Enum]"0"="PCI\\VEN_8086&DEV_24CD&SUBSYS_001F1025&REV_03\\3&18d45aa6&0&EF""Count"=dword:00000001"NextInstance"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub]"DisplayName"="Microsoft USB Standard Hub Driver""Group"="Boot bus extender""ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\  52,00,49,00,56,00,45,00,52,00,53,00,5c,00,75,00,73,00,62,00,68,00,75,00,62,\  00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001"Tag"=dword:0000001b[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub\Performance]"Library"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\  74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,75,\  00,73,00,62,00,70,00,65,00,72,00,66,00,2e,00,64,00,6c,00,6c,00,00,00"Open"="OpenUsbPerformanceData""Close"="CloseUsbPerformanceData""Collect"="CollectUsbPerformanceData""InstallType"=dword:00000001"PerfIniFile"="usbperf.ini""First Counter"=dword:00000d60"Last Counter"=dword:00000d82"First Help"=dword:00000d61"Last Help"=dword:00000d83[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub\Enum]"0"="Root\\LEGACY_USBHUB\\0000""Count"=dword:00000005"NextInstance"=dword:00000005"1"="USB\\ROOT_HUB\\4&b71b443&0""2"="USB\\ROOT_HUB\\4&1b0914a3&0""3"="USB\\ROOT_HUB\\4&33f1b84&0""4"="USB\\ROOT_HUB20\\4&dd5a51b&0"[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbohci]"DisplayName"="Microsoft USB Open Host Controller Miniport Driver""Group"="Boot bus extender""ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\  74,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,\  00,69,00,76,00,65,00,72,00,73,00,5c,00,75,00,73,00,62,00,6f,00,68,00,63,00,\  69,00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbohci\Enum]"0"="Root\\LEGACY_USBOHCI\\0000""Count"=dword:00000001"NextInstance"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]"DisplayName"="USB Mass Storage Driver""ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\  52,00,49,00,56,00,45,00,52,00,53,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,\  00,52,00,2e,00,53,00,59,00,53,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001"Group"="Boot bus extender""Tag"=dword:00000008[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Enum]"0"="Root\\LEGACY_USBSTOR\\0000""Count"=dword:00000002"NextInstance"=dword:00000002"1"="USB\\VID_067B&PID_2506\\0"[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbuhci]"DisplayName"="Microsoft USB Universal Host Controller Miniport Driver""Group"="Boot bus extender""ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\  52,00,49,00,56,00,45,00,52,00,53,00,5c,00,75,00,73,00,62,00,75,00,68,00,63,\  00,69,00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001"Tag"=dword:00000018[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbuhci\Enum]"0"="PCI\\VEN_8086&DEV_24C2&SUBSYS_001F1025&REV_03\\3&18d45aa6&0&E8""Count"=dword:00000003"NextInstance"=dword:00000003"1"="PCI\\VEN_8086&DEV_24C4&SUBSYS_001F1025&REV_03\\3&18d45aa6&0&E9""2"="PCI\\VEN_8086&DEV_24C7&SUBSYS_001F1025&REV_03\\3&18d45aa6&0&EA"


#8 Uncle_HQ

Uncle_HQ

    Newbie

  • Members
  • 28 posts
  •  
    United Arab Emirates

Posted 20 November 2009 - 10:18 PM

As I am definitely a noob on this subject, please bear with me while I ask some very basic “stupid” questions which must be self-explantory for most of you…but I seem to be missing the big picture. My apologies in advance….here I go:

1) Install in IDE/SATA disk and move to USB
a. At the end of step 7 in these set of procedures, we have installed Win 7 on a physical SATA drive.
b. Now, our next objective in Part 2 below will be to clone our SATA drive installation of Win 7 to a USB external disk {I’m thinking out loud here}
2) Cloning Windows 7 from IDE/SATA/VHD disk to USB disk
a. At the end of step 9 of these set of procedures, we have completed cloning our physical SATA HDD to an external USB HD.
3) Install in VHD by using virtual machine
a. Step 1 in this set of procedures says to “Create partition in USB disk (U:), format, make it active partition.” Here is where, my confusion begins….Are we creating a partition on the same external USB HD that was just cloned from a SATA physical HDD in Part 2 above ? Or are we introducing a 2nd USB HD here ? Why do we have to create a separate partition here ? We already have a full clone of our Win 7 from the SATA HD, why do we now need to create a separate partition ? What are we trying to achieve in this part ?
b. Where is the VHD supposed to be created ? On the new U: partition of the USB HD ?
c. Step 3 says to “In Windows Virtual PC folder or VirtualBox, create virtual machine RAM 1GB or more”. Where does this Virtual PC folder live ? On the host machine or on the USB HD ? If on the USB HD, then is this folder inside the new U: partition of the USB HD ?

#9 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    Thailand

Posted 21 November 2009 - 02:03 AM

2) a.
At the end of step 9 of these set of procedures, we have completed cloning our physical SATA HDD to an external USB HD.

After step9 is completed, you can boot computer from that USB disk.

3) a.
Here is where, my confusion begins….Are we creating a partition on the same external USB HD that was just cloned from a SATA physical HDD in Part 2 above ? Or are we introducing a 2nd USB HD here ?

No. No. After part2 is completed, your USB disk is ready for booting.
Part3 is just another story, another way to install. The tutorial above is updated to prevent new readers from this confusion.

3) b.
Where is the VHD supposed to be created ? On the new U: partition of the USB HD ?

Yes, if you want to boot from Windows in VHD in USB disk instead.
You can also create it in SATA disk first, and copy to USB disk later.

Where does this Virtual PC folder live ?

If you use Windows Virtual PC, you can open it from Star Menu - All Programs - Windows Virtual PC - Windows Virtual PC. It opens "%userprofile%\Virtual Machines" folder that contains list of your virtual machines. You can create new virtual machine from a toolbar button of that folder.

#10 Uncle_HQ

Uncle_HQ

    Newbie

  • Members
  • 28 posts
  •  
    United Arab Emirates

Posted 21 November 2009 - 08:42 PM

Thanks for the clarifications. I have another stupid question :cheers: , as I am new to Windows 7. In step 12, Under Install in VHD by using virtual machine (Windows Virtual PC or VirtualBox), we are told to "Copy bootmgr and Boot directory from V:\ to U:\". Is bootmgr a directory under Windows or is it a filename ? I could not locate it on my Windows 7 partition under \Windows. Where exactly can I find this on my host Windows 7 partition ?

In step 13, we are told to execute a series of cmds, "bcdedit /store U:\Boot\BCD ...." My boot directory under Windows, only has 4 sub directories, "DVD, EFI, Fonts, and PCAT". But command says to \Boot\BCD ? I don't see a BCD sub directory or and file named BCD under \Boot ? Am I missing something here ?

Once again, my apologies for asking questions which are probably too obvious and basic for most people. :)

Also, I noticed that Windows Virtual PC (64 bit version) does not allow you to create a 64 bit virtual machine installation of Windows 7 guest, even if your host machine is running on a x64 hardware & x64 OS. In my case, I want to create a 64 bit VHD of Win 7 Enterprise. So what I have done, is to take an existing 64 bit VHD installation of Win 7 which I created earlier (using my Win 7 Enterprise x64 DVD), and then applied the usbbootfix.bat to it, then shut down the VM, and attached it to my host Win 7 system using disk mgmt. I see no reason why this shouldn't work. Right ?

#11 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    Thailand

Posted 22 November 2009 - 07:01 AM

bootmgr is a hidden file in root directory of system partition.
Boot is a hidden directory in root directory of system partition.
Boot\BCD is a file in Boot directory.
I never know there is Boot subdirectory inside Windows directory. Thanks for this new knowledge.

There is an easier way to build BCD for boot from VHD in USB disk than in my tutorial part3 step 12-13.
- Boot into Windows 7.
After you connect USB disk (U:) and attach U:\filename.vhd (V:), run this command (replace U and V with your drive letters)
bcdboot V:\Windows /s U:


#12 Uncle_HQ

Uncle_HQ

    Newbie

  • Members
  • 28 posts
  •  
    United Arab Emirates

Posted 22 November 2009 - 08:19 PM

bootmgr is a hidden file in root directory of system partition.
Boot is a hidden directory in root directory of system partition.
Boot\BCD is a file in Boot directory.
I never know there is Boot subdirectory inside Windows directory. Thanks for this new knowledge.

There is an easier way to build BCD for boot from VHD in USB disk than in my tutorial part3 step 12-13.
- Boot into Windows 7.
After you connect USB disk (U:) and attach U:\filename.vhd (V:), run this command (replace U and V with your drive letters)

bcdboot V:\Windows /s U:


I followed your instructions for part 3,and for steps 12-1, as you had suggested I used bcdboot C:\Windows /s H:, where C: is the system partition of of Host PC, and H: is the external USB HD. Please refer to my attached screen shots for further clarification of my specific drive configuration. Afterwards, when I ran bcdedit /enum, I do not see the correct results. Please refer to my screen shot of BCDEDIT.jpg, after entering "bcdboot C:\Windows /s H:". I have also included screen shot of my diskmgmt. The attached VHD is mounted as I: in my system as per screenshot.

Now, when I detached the VHD, and re-booted my host PC, my system does not give me the option to boot from my VHD in USB ? Do I need to change my boot settings in my BIOS ? Shouldn't I get a menu of choices asking me whether I want to boot to my native Windows 7 or my VHD Bootable Win 7 from USB ?
What am I doing wrong here, or what have I missed ?

Attached Thumbnails

  • bcdedit.jpg
  • MyDiskMgmt.jpg
  • USB_DISK.jpg
  • AttachedVHD_Partition.JPG
  • My_HostSystemPartitionC_Drive.JPG


#13 SailorCM

SailorCM
  • Members
  • 2 posts
  •  
    Germany

Posted 22 November 2009 - 09:51 PM

OK after disabling the automatic reboot, I saw that the BSOD is with the dreaded stop code 0x7B. I am familiar with this, so on the laptop that boots fine, I just applied my great old usb_all.reg that changes important USB-related registry entries (usbehci, usbohci, usbuhci, usbccgp, usbhub, USBSTOR). Afterwards, now Windows 7 boots fine on both laptops from USB HDD !

Note that depending on the hardware, you are asked to reboot once to update the ACPIPIC/ACPIAPIC device (other drivers like network, sound... are already automatically searched and installed). So this is not 100% "portable" as with my current XP booting from USB HDD using usboot from usboot.org.

The method of usb_all.reg applied for Vista too already, so there is nothing new. usbwatcher.exe method seemingly tries to set to right values in registry, and karyonix's method seems to create a planned job that does same thing at initial boot time. I don't know why it does not work in my case.

Anyhow, to be sure, before any reboot, and especially after Windows update or driver update or USB plug-and-play, remember to apply usb_all.reg. This ensures that no BSOD 0x7B is hit on next boot. If ever you still get it, you have to offline change the registries (using RegEditPE or RegistryLoaderPE ) for these USB-related values (in fact the important key is Start which must be set to 0, usually we got BSOD 0x7B because Windows resets it to 3).

Here is usb_all.reg content:

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbccgp]"DisplayName"="Microsoft USB Generic Parent Driver""Group"="Boot bus extender""ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\  74,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,\  00,69,00,76,00,65,00,72,00,73,00,5c,00,75,00,73,00,62,00,63,00,63,00,67,00,\  70,00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbccgp\Enum]"0"="Root\\LEGACY_USBCCGP\\0000""Count"=dword:00000001"NextInstance"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbehci]"DisplayName"="Microsoft USB 2.0 Enhanced Host Controller Miniport Driver""Group"="Boot bus extender""ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\  52,00,49,00,56,00,45,00,52,00,53,00,5c,00,75,00,73,00,62,00,65,00,68,00,63,\  00,69,00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001"Tag"=dword:00000019[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbehci\Enum]"0"="PCI\\VEN_8086&DEV_24CD&SUBSYS_001F1025&REV_03\\3&18d45aa6&0&EF""Count"=dword:00000001"NextInstance"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub]"DisplayName"="Microsoft USB Standard Hub Driver""Group"="Boot bus extender""ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\  52,00,49,00,56,00,45,00,52,00,53,00,5c,00,75,00,73,00,62,00,68,00,75,00,62,\  00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001"Tag"=dword:0000001b[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub\Performance]"Library"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\  74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,75,\  00,73,00,62,00,70,00,65,00,72,00,66,00,2e,00,64,00,6c,00,6c,00,00,00"Open"="OpenUsbPerformanceData""Close"="CloseUsbPerformanceData""Collect"="CollectUsbPerformanceData""InstallType"=dword:00000001"PerfIniFile"="usbperf.ini""First Counter"=dword:00000d60"Last Counter"=dword:00000d82"First Help"=dword:00000d61"Last Help"=dword:00000d83[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub\Enum]"0"="Root\\LEGACY_USBHUB\\0000""Count"=dword:00000005"NextInstance"=dword:00000005"1"="USB\\ROOT_HUB\\4&b71b443&0""2"="USB\\ROOT_HUB\\4&1b0914a3&0""3"="USB\\ROOT_HUB\\4&33f1b84&0""4"="USB\\ROOT_HUB20\\4&dd5a51b&0"[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbohci]"DisplayName"="Microsoft USB Open Host Controller Miniport Driver""Group"="Boot bus extender""ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\  74,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,\  00,69,00,76,00,65,00,72,00,73,00,5c,00,75,00,73,00,62,00,6f,00,68,00,63,00,\  69,00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbohci\Enum]"0"="Root\\LEGACY_USBOHCI\\0000""Count"=dword:00000001"NextInstance"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]"DisplayName"="USB Mass Storage Driver""ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\  52,00,49,00,56,00,45,00,52,00,53,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,\  00,52,00,2e,00,53,00,59,00,53,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001"Group"="Boot bus extender""Tag"=dword:00000008[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Enum]"0"="Root\\LEGACY_USBSTOR\\0000""Count"=dword:00000002"NextInstance"=dword:00000002"1"="USB\\VID_067B&PID_2506\\0"[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbuhci]"DisplayName"="Microsoft USB Universal Host Controller Miniport Driver""Group"="Boot bus extender""ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\  52,00,49,00,56,00,45,00,52,00,53,00,5c,00,75,00,73,00,62,00,75,00,68,00,63,\  00,69,00,2e,00,73,00,79,00,73,00,00,00"ErrorControl"=dword:00000001"Start"=dword:00000000"Type"=dword:00000001"Tag"=dword:00000018[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbuhci\Enum]"0"="PCI\\VEN_8086&DEV_24C2&SUBSYS_001F1025&REV_03\\3&18d45aa6&0&E8""Count"=dword:00000003"NextInstance"=dword:00000003"1"="PCI\\VEN_8086&DEV_24C4&SUBSYS_001F1025&REV_03\\3&18d45aa6&0&E9""2"="PCI\\VEN_8086&DEV_24C7&SUBSYS_001F1025&REV_03\\3&18d45aa6&0&EA"


i had Windows 7 running (RC1) from USB 3 month ago using a XP tutorial to boot from USB.
I also found out that every boot windows updates the configuration of the usb-services and next time i rebootet i run into a 0x7B.

I just added SYSTEM to the permissions of the USB-keys that need to be updated and disallowed WRITE-access to this key for SYSTEM

#14 SailorCM

SailorCM
  • Members
  • 2 posts
  •  
    Germany

Posted 22 November 2009 - 09:57 PM

you are also unable to have a swapfile on this disk

#15 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    Thailand

Posted 22 November 2009 - 11:53 PM

@Uncle_HQ
  • If you want to boot Windows inside VHD (I:) when you boot from internal disk, use this command.
    bcdboot I:\Windows
    Read BCD in current system partition.
    bcdedit
  • If you want to boot Windows inside VHD (I:) when you set your BIOS to boot from USB disk, also tell the program your USB system partition (H:).
    bcdboot I:\Windows /s H:
    Read BCD in H:.
    bcdedit /store H:\Boot\BCD


#16 Uncle_HQ

Uncle_HQ

    Newbie

  • Members
  • 28 posts
  •  
    United Arab Emirates

Posted 23 November 2009 - 04:49 AM

@Uncle_HQ

  • If you want to boot Windows inside VHD (I:) when you boot from internal disk, use this command.
    bcdboot I:\Windows
    Read BCD in current system partition.
    bcdedit
  • If you want to boot Windows inside VHD (I:) when you set your BIOS to boot from USB disk, also tell the program your USB system partition (H:).
    bcdboot I:\Windows /s H:
    Read BCD in H:.
    bcdedit /store H:\Boot\BCD


Dear karyonix,

My PC is still not booting from my USB hard drive. My BCD store seems to be ok, from what I see (please refer to attachment). Prior to booting, I have configured the following settings in my BIOS:

First Boot Device: USB-HDD
Second Boot Device: USB-FDD
Third Boot Device: USB-ZIP

(Note: I have a prior pre-existing Windows 7 physical installation on C: drive of my internal SATA hard drive. Now I want it to boot from my external USB VHD installation of Win 7 instead.)

Despite all this, after my PC passes the initial BIOS logo screen, I do not see any USB hard drive activity LEDs lighting up during boot up. Instead, the internal (SATA) hard drive of my PC starts cranking away (LEDs go off), and Windows 7 is loaded from my PC's internal SATA hard drive.

My BCD store looks ok to me. Can you see any problems with it as per attachment ?
Could it be that I may have made some mistake in steps 1-10 from part 3 ? If that were the case, then I should have seen some other error at bootup, saying that there is something wrong with my boot partition, right ? But its not even hitting my USB disk at boot up. Thanks for your help!

Attached Thumbnails

  • bcdedit2.JPG


#17 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 451 posts
  •  
    Thailand

Posted 23 November 2009 - 05:39 AM

Your BCD seems to be OK.

Your BIOS don't read USB hard disk during boot.
Connect USB harddisk directly to USB port on motherboard. Don't connect it to USB hub or multifunction front panel.
Make sure you enable Legacy USB support in BIOS.
Disable BIOS logo, so you can see its message.
Some BIOS have hotkey to bring up boot selection menu that allow you to select which drive you want it to boot from.

Another place that can cause problem is USB disk MBR. Make sure it has boot code in its first 440 bytes.

#18 Uncle_HQ

Uncle_HQ

    Newbie

  • Members
  • 28 posts
  •  
    United Arab Emirates

Posted 24 November 2009 - 07:13 PM

Your BCD seems to be OK.

Your BIOS don't read USB hard disk during boot.
Connect USB harddisk directly to USB port on motherboard. Don't connect it to USB hub or multifunction front panel.
Make sure you enable Legacy USB support in BIOS.
Disable BIOS logo, so you can see its message.
Some BIOS have hotkey to bring up boot selection menu that allow you to select which drive you want it to boot from.

Another place that can cause problem is USB disk MBR. Make sure it has boot code in its first 440 bytes.


Dear Karyonix,

Thanks to all your assistance, I finally managed to get it to work. I tried booting my USB disk on other computers and it worked just fine. Therefore, there must have been an issue with the USB port on the desktop PC which I was using even after enabling legacy USB support. Thanks again for all your help with this.

#19 Dougal

Dougal

    Newbie

  • Members
  • 14 posts
  •  
    Australia

Posted 25 November 2009 - 12:57 AM

Your BCD seems to be OK.

Your BIOS don't read USB hard disk during boot.
Connect USB harddisk directly to USB port on motherboard. Don't connect it to USB hub or multifunction front panel.
Make sure you enable Legacy USB support in BIOS.
Disable BIOS logo, so you can see its message.
Some BIOS have hotkey to bring up boot selection menu that allow you to select which drive you want it to boot from.

Another place that can cause problem is USB disk MBR. Make sure it has boot code in its first 440 bytes.


Not sure if it is the cause, but I have found USB hard drives (as against USB flash drives) tend to have a small start up time during which they may not be recognised by the BIOS, resulting in them not booting even when they are enabled in the BIOS as first boot device. This may be affected by having POST turned off, I haven't experimented.

I find that in these cases if I can get the BIOS to pause for a few seconds it will then find and boot from the hard drive. I generally achieve this by using whatever key brings up the menu to select boot order or source menu, then wait 5 seconds before selecting the external hard drive. This applies on Toshiba and HP laptops I have used.

Cheers

#20 pedude

pedude
  • Members
  • 4 posts
  • Location:Amsterdam +3120
  •  
    Nepal

Posted 25 November 2009 - 01:54 PM

Great to have something todo...looking forward to give this manual a go and test but i am also very happy with my embedded windows xp on usb by usboot.org Posted Image

#21 edborg

edborg

    Frequent Member

  • .script developer
  • 387 posts
  •  
    Italy

Posted 29 November 2009 - 07:42 AM

This method works!
Thanks to karyonix, and thanks to Nuno for bringing it to our attention. :rofl:

As the tutorial is very concise, it's not been that easy to follow: the importance of any single step may be overlooked and confusion may arise that leads to unsuccess. :thumbup:
At least, that happened to me. :rofl:
Success came only after many failures, due to my misunderstandings, not to errors in the tutorial.
Questions and observations of others also helped me understand, thanks to ktp and Uncle_HQ, too.
Anyway, a more detailed tutorial explaining reasons and purposes of any step might help. :thumbup:

There are two main methods here: first plus second (install to internal HD + clone to USB HD) and third plus second (install to VHD + clone to USB HD).
What I did is third (install to VHD) plus image/restore to USB HD of the content of VHD, as others suggested.

After reading this article and understanding a bit more of the subject I generalised the BCD to point to "boot", not to the specific drive letter as in clone7.bat, to make it more portable.
I tested it on two different PCs and it works perfectly on both, without the problems initially reported by Uncle_HQ.

Thanks to all for sharing this knowledge.
The automated method in usbbootfix.bat is a major step forward after the great Dietmar's manual method for XP, and the power of VHD makes it possible to overcome Vista/Win7 unwillingness to install to an external HD.

edborg

#22 Uncle_HQ

Uncle_HQ

    Newbie

  • Members
  • 28 posts
  •  
    United Arab Emirates

Posted 29 November 2009 - 08:32 AM

I wanted to share some additional experiences that I have been fighting recently related to this subject. Thanks to assistance provided by Karyonix, I was finally successful in being able to boot a Win 7 VHD from an external USB hdd. My next challenge, was being able to achieve the same results using a USB flash disk. I used a 16 GB SanDisk Cruzer Titanium USB Flash Stick. Here are the steps I took:
There is a U3 launch application which always gets launched as soon as you stick in the USB flash stick into a PC USB port. So, first I deleted this hidden partition using the instructions on SanDisk's web site, since all other efforts failed. Next, I used Acronis Disk Management suite to remove the FAT32 partition and created a NTFS primary partition, and set it active. After formatting the drive, I proceeded to follow Karyonix's part 3 procedures for creating a bootable Win 7 VHD from USB. I had created a 15 GB fixed type VHD using disk part. After following all the steps for step 3, I tried booting from the USB but recieved an error "Invalid boot partition". So I started over from scratch and did the following:

1) [codebox]select disk 1 clean create partition primary select partition 1 active format fs=NTFS assign exit [/codebox] 2) Next I used used bootsect to set the USB as a bootable NTFS drive prepared for a Windows 7 image. [codebox]bootsect /nt60 g: [/codebox]
I next copied over my pre-created Bootable Win 7 VHD (15 GB) to my 16 GB Sandisk Cruzer. Note: I now had 187 mb free on this disk. I proceeded to follow the rest of karyonix's steps for part 3, including running usbbootfix.bat as admin.
3) After detaching the VHD, and shutting down my PC, I rebooted my laptop from the Sandisk Cruzer USB Flash Stick (had to tell my BIOS to boot from USB).
Now, everything boots correctly and loads up Win 7 from the USB flash stick. But, it is extremely slow, to the point of being unusable. It took my about 20 minutes to boot from the USB, and then everything was barely crawling. After each click, the system took minutes to respond. shutting down also took about 20 minutes. I checked device manager, and although it took ages to get there due to slow response time, everything looked normal. CPU utilization was hardly 2 % and memory available for 3.5 out of 4 GB on a 64 bit system. Could it be disk swapping since I only have 187 mb available on a 16 Gb flash stick where my VHD file size was 15 GB. Looking forward to your inputs on what could be going wrong, and how to rectify this problem. Thanks.

#23 wimb

wimb

    Gold Member

  • Developer
  • 2281 posts
  •  
    Netherlands

Posted 29 November 2009 - 09:34 AM

Recently Install of Windows 7 on USB-HDD was automated
by using IMG_XP_Create.exe and IMG_XP_Restore.exe of IMG_XP.exe package.

More Info:

Universal HDD Image files for XP and Windows 7
http://www.boot-land...?showtopic=9830

  • Run IMG_XP_Create.exe to make 7.0 GB NTFS compressed HDD Image File of Drive with non-running Windows 7
  • Use IMG_XP_Restore.exe to Restore Windows 7 on your USB-HDD using HDD Image file



#24 edborg

edborg

    Frequent Member

  • .script developer
  • 387 posts
  •  
    Italy

Posted 30 November 2009 - 10:09 AM

I next copied over my pre-created Bootable Win 7 VHD (15 GB) to my 16 GB Sandisk Cruzer. Note: I now had 187 mb free on this disk.

You should have a lot more free space available! ;)

How did you do that exactly?
Apparently you ended up with the content of your VHD that should include a lot of free space (more than 50% in my installation) "separated" from the extra free space of your USB stick, and perhaps Windows has only access to this extra free space, which is not enough.

Try making an image of the content of your VHD, and then restoring it to the USB stick.
I did it with DriveSnapshot, that asked me to "adjust" the size of the image to 16 GB instead of 15 GB. This would let Windows access the whole available space, almost 10 GB, not 187 MB!

Hope it helps :thumbup:
edborg

#25 Uncle_HQ

Uncle_HQ

    Newbie

  • Members
  • 28 posts
  •  
    United Arab Emirates

Posted 01 December 2009 - 12:56 PM

You should have a lot more free space available! :clap:

How did you do that exactly?
Apparently you ended up with the content of your VHD that should include a lot of free space (more than 50% in my installation) "separated" from the extra free space of your USB stick, and perhaps Windows has only access to this extra free space, which is not enough.

Try making an image of the content of your VHD, and then restoring it to the USB stick.
I did it with DriveSnapshot, that asked me to "adjust" the size of the image to 16 GB instead of 15 GB. This would let Windows access the whole available space, almost 10 GB, not 187 MB!

Hope it helps :clap:
edborg


I tried creating a new bootable Win7 VHD (12 GB), and I now have over 3 GB free on my USB Stick. Although my new Win7 loads up from the USB stick, but it still takes forever to do so. Everything is so screeching slow..hence it is useless. Perhaps I have a bad USB stick, unless there was a special procedure I should have followed to prepare my USB stick to boot from Win7. Since it boots up correctly, I doubt that is the case. Everything works correctly, when I boot up from an external USB HDD...but when I boot from my USB Stick (Sandisk Cruzer Titanium) it slows down my user experience to the point where it is completely un-useable. Could there be a hardware issue going on ? I did run the usbbootfix.bat before booting up from it. Also, I did not see any hardware device conflicts in yellow.
Any ideas...otherwise, I will have to throw in the towel, until I can get my hands on another 16 GB USB stick.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users