Hello dear guest!

Boot Land is a community driven site established since 2006 and focused on data recovery/backup boot disks, research of Windows 2000/XP/2003/Vista/7 install/deployment/antivirus tools, customizing Windows PE systems and even learning how to recover from disaster situations.

How about joining our boot disk community? So do it. Life's short!

  - You get free access to our newsletter with all the interesting buzz about boot disks
  - We share publicity revenue with everyone who wishes to participate at the forums
  - Publicity is never, never, never displayed to members (along with many other cool things)
http://boot-land.net/register

4 Pages V   1 2 3 > »   
Reply to this topic
 [Tutorial] Boot and run Windows 7 from USB hard disk by Marietto2009
post Sep 25 2009, 09:46 PM
Post #1
Marietto2009
Frequent Member   ***
Group: Members

  Joined: 26-August 09 From: Italy

Posts: 113
Thank(s): 8


Italy


This is what I did :

1] Created the Windows PE 3.0 image file :

a) imagex /mountrw c:\winpe\winpe.wim 1 c:\winpe\mount

b) xcopy "c:\Program Files\Windows AIK\Tools\Servicing" c:\winpe\mount\Windows /s

c) xcopy "c:\Program Files\Windows AIK\Tools\x86" c:\winpe\mount\Windows /s /y

d) imagex /unmount c:\winpe\mount /commit

e) copy c:\winpe\winpe.wim c:\winpe\ISO\sources\boot.wim /y

f) oscdimg -n -bc:\winpe\etfsboot.com c:\winpe\ISO c:\winpe\winpe.iso


2] Copied Windows 7 files from DVD source to "(hd0,0)\Win7" directory

3] Booted into WinPE and identified (hd0,0) as C: drive

3.1] imagex /mountrw C:\win7\sources\install.wim 5 C:\7

3.2] gone into C:\7\windows\inf and edited files :

usb.inf

CODE
;[SignatureAttributes]
;usbccgp.sys=SignatureAttributes.DRM
;usbhub.sys=SignatureAttributes.DRM

[StandardHub.AddService]
DisplayName = %StandardHub.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbhub.sys
;LoadOrderGroup = Base
LoadOrderGroup = System Bus Extender



usbport.inf
CODE

[ControlFlags]
;BasicDriverOk = *
;ExcludeFromSelect = *

;[SignatureAttributes]
;usbehci.sys=SignatureAttributes.DRM
;usbhub.sys=SignatureAttributes.DRM
;usbohci.sys=SignatureAttributes.DRM
;usbport.sys=SignatureAttributes.DRM
;usbuhci.sys=SignatureAttributes.DRM

;[SignatureAttributes.DRM]
;DRMLevel=1300

[EHCI.AddReg.NT]
HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider"
HKR,,Controller,1,01
;HKLM,System\CurrentControlSet\Services\usbehci,BootFlags,0x00010003,4

[EHCI.AddService]
DisplayName = %EHCIMP.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbehci.sys
;LoadOrderGroup = Base
LoadOrderGroup = Boot Bus Extender

[OHCI.AddReg.NT]
HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider"
HKR,,Controller,1,01
;HKLM,System\CurrentControlSet\Services\usbohci,BootFlags,0x00010003,4

[OHCI.AddService]
DisplayName = %OHCIMP.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbohci.sys
;LoadOrderGroup = Base
LoadOrderGroup = Boot Bus Extender

[UHCI.AddReg.NT]
HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider"
HKR,,Controller,1,01
;HKLM,System\CurrentControlSet\Services\usbuhci,BootFlags,0x00010003,4


[UHCI.AddService]
DisplayName = %UHCIMP.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbuhci.sys
;LoadOrderGroup = Base
LoadOrderGroup = Boot Bus Extender

[ROOTHUB.AddReg.NT]
HKR,,EnumPropPages32,,"usbui.dll,USBHubPropPageProvider"
;HKLM,System\CurrentControlSet\Services\usbhub,BootFlags,0x00010003,4

[ROOTHUB.AddService]
DisplayName = %ROOTHUB.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbhub.sys
;LoadOrderGroup = Base
LoadOrderGroup = System Bus Extender


usbstor.inf

CODE
[USBSTOR.AddService]
DisplayName = %USBSTOR.SvcDesc%
ServiceType = 1
;StartType = 3
StartType = 0
ErrorControl = 1
ServiceBinary = %12%\USBSTOR.SYS
LoadOrderGroup = System Bus Extender


3.3] imagex /unmount /commit C:\7

4] Started diskpart and entered the following commands to create a 16GB .vhd file :

a) create vdisk file=C:\win7.vhd type=fixed maximum=16000
b) select vdisk file=C:\win7.vhd
c) attach vdisk
d) exit

5] Ran the Windows 7 setup file on "C:\Win7\setup.exe" (from directory Win7 on disk (hd0,0)).

6] Installed Windows on the Unallocated Space until first reboot.

7] During the installation,the BCD store has been automatically created on the active partition on (hd0,0). I booted Windows 7 from it and the installation has been completed.

8] Booted the VHD image file from Sata disk and imported this file into registry :

CODE
REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\UsbBootWatcherService]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000000
"ImagePath"=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,\
32,5c,55,73,62,42,6f,6f,74,57,61,74,63,68,65,72,2e,65,78,65,00
"DisplayName"="Usb Boot Watcher Service"
"ObjectName"="LocalSystem"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\UsbBootWatcherService]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\UsbBootWatcherService]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide]
"Start"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\intelide]
"Start"=dword:00000000


9] Enabled Auto Reboot On System Crash

10] Booted WIndows 7 from Sata disk and copied win7.VHD into USB disk

11] Booted Windows 7 on USB disk and created entries to boot the VHD image file :

c:\windows\system32>bcdedit /copy {current} /d "Boot From VHD"

The entry was succesfully copied to {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a}

c:\windows\system32>bcdedit /set {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a} device vhd=[C:]\win7.vhd

c:\windows\system32>bcdedit /set {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a} osdevice vhd=[C:]\win7.vhd

c:\windows\system32>bcdedit /set {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a} detecthal on

c:\windows\system32>bcdedit /set {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a} description "VHD Boot"

This post has been edited by jaclaz: Nov 5 2009, 08:08 PM


4 user(s) said "Thank you!" to Marietto2009 for this fantastic post:
fxscrpt, Nuno Brito, operat0r, wimb
+Quote Post
post Dec 16 2009, 09:58 PM
Post #2
operat0r
Newbie   *
Group: Members

  Joined: 16-December 09
Posts: 20
Thank(s): 1


United States


I am having issues with this step ...do I need to run this booted from the ISO c:\winpe\winpe.iso ???!?

I did extract the win7 iso from a program I will try burning the ISO then comparing the difference maybe MagicISO Maker 5.5 Portable.exe did not extract it properly.

3.1] imagex /mountrw C:\win7\sources\install.wim 5 C:\7

Windows PE Tools Command Prompt
CODE
Updating path to include peimg, oscdimg, imagex

   C:\Program Files\Windows AIK\Tools\PETools\
   C:\Program Files\Windows AIK\Tools\PETools\..\x86


C:\Program Files\Windows AIK\Tools\PETools>imagex /mountrw C:\win7\sources\insta
ll.wim 5 C:\7

ImageX Tool for Windows
Copyright (C) Microsoft Corp. 1981-2005. All rights reserved.



The data is invalid.

C:\Program Files\Windows AIK\Tools\PETools>


+Quote Post
post Dec 17 2009, 07:39 AM
Post #3
Marietto2009
Frequent Member   ***
Group: Members

  Joined: 26-August 09 From: Italy

Posts: 113
Thank(s): 8


Italy


This is what you have to do :

1] Boot any version of Windows and copy Windows 7 files from DVD source to C:\Win7 directory

2] Burn the WinPE.iso image to a cd

3] Boot into WinPE from the cd just burned

4] Write this command : imagex /mountrw C:\win7\sources\install.wim 5 C:\7
+Quote Post
post Dec 17 2009, 06:39 PM
Post #4
operat0r
Newbie   *
Group: Members

  Joined: 16-December 09
Posts: 20
Thank(s): 1


United States


6] Installed Windows on the Unallocated Space until first reboot.
install on what ?? create a new partition on the MAIN HDD and install windows on that ( two copies of windows on one HDD one using the updated inf's ? )

or install windows to the USB stick ? the use of (hd0,0) and "Sata disk" im at a loss as to whats what the hd0,0 is?? the main drive? "Sata disk" is a second HDD or ?


11] Booted Windows 7 on USB disk and created entries to boot the VHD image file
resolving the above may answer my question but:
how do you boot windows 7 on usb disk if it was never installed on USB disk ? or do I install it to usb disk using the updated inf setup?
* this vhd file is read write IE a REAL install of windows on the USB stick running from a VHD file that can be updated etc ?

BTW this VHD stuff seems really cool !!! can you create a XP image in the same way so I could replace my current usboot.org solution with a single VHD file ?
+Quote Post
post Dec 17 2009, 10:28 PM
Post #5
Marietto2009
Frequent Member   ***
Group: Members

  Joined: 26-August 09 From: Italy

Posts: 113
Thank(s): 8


Italy


hd (0,0) = SATA disk with Windows 7 already installed

Windows 7 should be installed on the VHD file

when the computer has rebooted,you will see a new entry on the MBR of the hd (0,0) SATA disk,(Windows 7 running from the VHD image file). You have to boot and continue the installation of Windows 7 by choosing it.
+Quote Post
post Dec 18 2009, 02:10 AM
Post #6
operat0r
Newbie   *
Group: Members

  Joined: 16-December 09
Posts: 20
Thank(s): 1


United States


ok so after I do the attach vdisk I should be able to see a new place to install windows 7
then reboot and I should see a new entry to boot from the VHD file make the other changes ok I get that much

11] Booted Windows 7 on USB disk and created entries to boot the VHD image file :

Not sure on this step .... Ok so copy the VHD file to the usb stick ( say its 16gig NFTS ) but how do I tell it to boot from usb and also use the VHD file ? also I noticed the boot stuff for windows7 is not the NTDLR stuff ? I googled a bit I guess I need more info on howto get a usb stick to boot a VHD file ?

Again thank you so much for your time !! im SO CLOSE smile.gif

I also may include driverpacks.net ( unofficial driver packs for x86 and 64 NIC and WIFI )
cool.gif
+Quote Post
post Dec 18 2009, 12:02 PM
Post #7
Marietto2009
Frequent Member   ***
Group: Members

  Joined: 26-August 09 From: Italy

Posts: 113
Thank(s): 8


Italy


clone the \ partition of the SATA disk (where you saved the win7.vhd image file) to the USB disk. I used Macrium Reflect Free Edition.
+Quote Post
post Dec 18 2009, 07:08 PM
Post #8
operat0r
Newbie   *
Group: Members

  Joined: 16-December 09
Posts: 20
Thank(s): 1


United States


im ok upto step 5] I think ;/ I have the fixed inf files and the vhd mounted ( in normal mode but not mounted via winpe.iso boot ..

* I am unable to do much on the winpe.iso ... when I run diskpart there is no vdisk support etc .. do I have to set up the vdisk/install via winpe ? if so thats a problem because create does not list vdisk ..
* do I need to run the " C:\Windows\System32\cmd.exe /k "C:\Program Files\Windows AIK\Tools\PETools\pesetenv.cmd" " some how from winpe or should the diskpart /mount just work ? I also tried running the diskpart.exe in c:\windows\system32\ but it just crashes smile.gif

* wont let me install win7 it on a vdisk ( booted from the main HDD )


5] Ran the Windows 7 setup file on "C:\Win7\setup.exe" (from directory Win7 on disk (hd0,0)).
6] Installed Windows on the Unallocated Space until first reboot.
from the booted winpe.iso install windows to the mounted VHD file right ?
again winpe.iso wont let me create vdisk etc ..so this would be a problem

7] During the installation,the BCD store has been automatically created on the active partition on (hd0,0). I booted Windows 7 from it and the installation has been completed.
8] Booted the VHD image file from Sata disk and imported this file into registry :
so on reboot from what I can tell it boots to the last installed disk in our case the VHD file right ? 2nd choice would be the main real drive

10] Booted WIndows 7 from Sata disk and copied win7.VHD into USB disk
ok stil not sure how the usb is pose to be setup ... you said "clone the \ partition of the SATA disk" to usb so while its mounted clone the vdisk mounted partiton to the usb stick ?

I tried to push the fixed image / reg patches etc to the usb stick.
* install windows on 2nd part on the main disk
* booted to it ( with the first partition being the active BOOT partition ) did all the reg patches checked the inf etc
* copyied the mbr to the usb dd if=/dev/hda of=/dev/sda bs=512 count=1
but no luck looking into the \boot\bcd file if I just need to edit that manually and set it to boot to 0,0 dun know ...

+Quote Post
post Dec 20 2009, 06:30 PM
Post #9
Marietto2009
Frequent Member   ***
Group: Members

  Joined: 26-August 09 From: Italy

Posts: 113
Thank(s): 8


Italy


Restart everything from the beginning. I will follow you step by step. The first thing is to do a normal installation of Windows 7 on a SATA disk.
+Quote Post
post Dec 21 2009, 01:24 PM
Post #10
operat0r
Newbie   *
Group: Members

  Joined: 16-December 09
Posts: 20
Thank(s): 1


United States


I am using VMware I got plain install of windows 7 on IDE 0:0 smile.gif
+Quote Post

4 Pages V   1 2 3 > » 
Reply to this topic
1 User(s) are reading this topic ()


  

Collapse

  Topic Replies Topic Starter Views Last Action
No New Posts Booting from Acronis Secure Zone
1 Frozen 98 Yesterday, 11:47 AM
Last post by: Wonko the Sane
No New Posts BOOT-Land, seems like a place to solve my boot problem..
Need to repair my XP MBR
1 Bob K. 123 Yesterday, 10:43 AM
Last post by: Wonko the Sane
No New Posts Boot CD for XP pro with USB Keyboard Support
6 petercherry 493 7th February 2010 - 06:04 PM
Last post by: Wonko the Sane
No New Posts USBoot w/XPsp2 not booting after DiskCryptor system encryption
BSOD Stop Code = UNMOUNTABLE_BOOT_VOLUME
4 Zoso 1,292 6th February 2010 - 11:38 AM
Last post by: Wonko the Sane
No New Posts Boot WDS and LTSP with pxelinux
2 awergh 289 4th February 2010 - 06:11 PM
Last post by: Icecube