Jump to content

How to Really Boot PE 2.0 into RAM from a Hard Disk


WreX

Recommended Posts

I'm working on a system that will use the Vista Boot Loader to either boot PE into RAM from a WIM on the C: drive, or boot into Win2K / XP on the D: drive using NTLDR. In my efforts to track down how to do this I looked in all of Microsoft's help and walkthroughs and several forum posts but I never found the whole thing at once. Well if you're trying to do the same thing I am, you're in luck, because I figured it out and thought I'd share. This also installs the Vista Boot Loader on a PC that didn't already have it.

First create a bootable PE RAM image on CD or UFD that includes BOOTSECT.EXE in \Windows\System32\ and boot to it. The following commands assume C: is the primary, active partition, has been formatted, and has BOOT.INI, NTLDR, and NTDETECT.COM at the root. D: contains the Win2K / XP files. E: is the bootable media's drive letter.


xcopy e:\boot\*.* /s /e /f c:\boot\
xcopy e:\sources\*.* /s /e /f c:\sources\
copy e:\bootmgr c:\
del c:\boot\bcd

if not exist c:\temp md c:\temp
bcdedit -createstore c:\temp\bcd
bcdedit -store c:\temp\bcd -create {bootmgr} /d "Boot Manager"
bcdedit -store c:\temp\bcd -set {bootmgr} device boot
bcdedit -store c:\temp\bcd -create {ramdiskoptions} /d "WinPE"
bcdedit -import c:\temp\bcd

bcdedit -set {ramdiskoptions} ramdisksdidevice partition=c:
bcdedit -set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
for /f "tokens=3" %%a in ('bcdedit -create /d "WinPE" -application osloader') do set guid=%%a
bcdedit -set %guid% device ramdisk=[c:]\sources\boot.wim,{ramdiskoptions}
bcdedit -set %guid% path \windows\system32\boot\winload.exe
bcdedit -set %guid% osdevice ramdisk=[c:]\sources\boot.wim,{ramdiskoptions}
bcdedit -set %guid% systemroot \windows
bcdedit -set %guid% winpe yes
bcdedit -set %guid% detecthal yes
bcdedit -displayorder %guid% -addlast

bcdedit -store c:\boot\bcd -create {ntldr} /d "Windows XP Professional"
bcdedit -store c:\boot\bcd -set {ntldr} device boot
bcdedit -store c:\boot\bcd -set {ntldr} path \ntldr
bcdedit -store c:\boot\bcd -displayorder {ntldr} –addfirst
bcdedit -store c:\boot\bcd -default {ntldr}
bcdedit -store c:\boot\bcd -timeout 5

bootsect /nt60 c:

"bootsect /nt60 c:" points the boot sector on C: to the Vista Boot Loader instead of NTLDR.

All the Micro$oft documentation I've looked at has been missing \boot\ from the "path \windows\system32\boot\winload.exe" commands, and the WinPE help file that's supposed to show you how to create a bootable PE RAM disk on a hard drive doesn't tell you how to configure the boot loader. Hope this helps anyone who may be struggling with this stuff.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...