Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


chiraag

Dual boot between Winpe and WinXP

Recommended Posts

Hello Everyone,

I am trying to build something which need me to switch between Win PE and Win XP. My system has the following:

Disk 0

C: WinPE [Partition 1]

D: WinXP [Partition 2]

Disk 1

e: USB [WinPE]

Here i boot the uSB and let it load WinPE in ram. After this I am using the solution by Wrex described on this discussion [http://www.msfn.org/board/index.php?showtopic=118332&st=0&p=768846entry768846] where i do the following

xcopy e:\Boot\*.* /e/f/y c:\Boot
copy e:\BootMGR c:\
IF EXIST C:\BOOT\BCD DEL C:\BOOT\BCD
IF NOT EXIST C:\TEMP MD C:\TEMP
IF EXIST C:\TEMP\BCD DEL C:\TEMP\BCD
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:]\WINPE\WINPE.WIM,{ramdiskoptions}
bcdedit -set %guid% path \WINDOWS\SYSTEM32\BOOT\WINLOAD.EXE
bcdedit -set %guid% osdevice ramdisk=[C:]\WINPE\WINPE.WIM,{ramdiskoptions}
bcdedit -set %guid% systemroot \WINDOWS
bcdedit -set %guid% winpe yes
bcdedit -set %guid% detecthal yes
bcdedit -displayorder %guid% -addlast
bcdedit -create {ntldr} /d "Windows XP Professional"
bcdedit -set {ntldr} device boot
bcdedit -set {ntldr} path \ntldr
bcdedit -displayorder {ntldr} -addfirst
bcdedit -default {ntldr}
bcdedit -timeout 5
bootsect /nt60 C:

I also add NTLDR, NTDETECT.COM, and boot.ini files in the root of C: [i get these files from my windows xp cd]

My boot.ini file is as follows

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

Now when i execute this code and restart my machine, it starts my windows xp but after displaying the Windows XP logo it hangs on the windows xp blue screen [before it displays login screen]

I am really not sure what i am doing wrong here. I guess it could be something regarding the ndldr files i am using as i have never seen Windows XP start booting and hang in between.

Please help..........

~Chiraag

Share this post


Link to post
Share on other sites

I XP is in:

Disk 0

C: WinPE [Partition 1]

D: WinXP [Partition 2]

why are you chainloading:

[boot loader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

Add a line to BOOT.INI as follows:

multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

Also, generally "blue screen" means nothing, you must provide the STOP error number or however the text that is displayed when the error happens in order for anyone to help.

jaclaz

Share this post


Link to post
Share on other sites

My systems have WinPE on C: and Windows on D: as well and yes, all you should need to do is change your (1) values in boot.ini to (2) and it should boot properly. That would make your boot.ini look like mine and get you where you need to go.

Share this post


Link to post
Share on other sites

oh thats my bad, actually i have my boot.ini set to partition 2 and it still does not boot.

multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

The blue screen is not an error screen or something, if u observe, while booting, WinXP first displays a big Microsoft Windows XP logo then it displays a small windows xp logo after which it displays a welcome message and lastly the login screen.

My machine hangs on the small windows xp logo [i.e it does not show me welcome]. Hope this makes sense.

Wrex in order to boot your winxp you place NTLDR, NTDETECT.COM, and boot.ini files in the root of C: [Win PE] and do you get these files from the windows xp cd or you are using the pe version of all these files....

Thanks so much for all these replies....would be great if i could solve this issue....

Edited by Tripredacus
added codebox

Share this post


Link to post
Share on other sites

Ok,

but I need some more details.

How was XP installed?

Was it installed while the partition where WinPE now is was hidden/not yet existant?

Did it boot normally before?

The code by Wrex is just a way to add the entries to the BCD needed to chainload from bootmanager NTLDR (and from it BOOT.INI)

The "stall" you are reporting is usually somehow connected to changed drive letters. :unsure:

jaclaz

Share this post


Link to post
Share on other sites

I have a bear metal on which i boot WinPE through a USB [e:]. Then i use diskpart to create two partitions in disk 0.

Partition 1 [c:]= Winpe [using http://technet.microsoft.com/en-us/library/cc766195.aspx]

Partition 2 [d:]= Winxp ..

For WinXP i first create a partition [as shown below] and then copy an image [e:\imagex.exe /apply f:\Image.wim 1 d:]

diskpart 
select disk 0
create partition primary size=<Size of partition to create in MB>
select partition 2
active
exit
format d: /fs:ntfs /y

After i have copied the winxp image i add entries to BCD [using Wrex code] and then restart my machine. What i actually want is that when i restart i get winxp.

Share this post


Link to post
Share on other sites
After i have copied the winxp image i add entries to BCD [using Wrex code] and then restart my machine. What i actually want is that when i restart i get winxp.

I'll try to rephrase. :)

Where does the XP image come from?

Was it an XP installed on first partiton (with drive letter C:\)?

How are you managing the MBR disk signature?

jaclaz

Share this post


Link to post
Share on other sites

I have an image of Winxp [image1.wim] on a uSB. I capture this image of another Windows xp machine [After Syspreping that machine to factory [sysprep.exe –factory]] using the following command.

ImageX /capture C:   E:\Image1.wim   " factory image"

YES!!!! this other machine from where i captured the image did have WinXP installed on first partition ( C:\)

I am sorry i am not aware of how MBR disk signature is managed. How could i check that??

After i have captured this image from another machine, i restore this image in the D drive [Partition 2] using the command

e:\imagex.exe /apply f:\Image.wim 1 d:

Once i have copied the image, i add BCD entries [Wrex code] and then i restart my machine to expect Winxp to boot.

I hope i am clear, the setup is a bit complicated. thanks soo much for your quick responses. Appreciate that.

Share this post


Link to post
Share on other sites

Actually XP boot is based on some information that is "hardcoded" to a given machine, and also to some "paths".

I am not familiar with the sysprepping procedure :unsure: , so this might be a loonng (or completely wrong :ph34r: ) shot, based only on the symptoms.

MBR signature:

http://thestarman.pcministry.com/asm/mbr/Win2kmbr.htm

http://www.911cd.net/forums//index.php?showtopic=19663

Problem about "moving" 2K/XP:

http://support.microsoft.com/kb/249321/en-us

If I were you, I would simply try restoring (temporarily) the image you have on first partition of the new machine and see if anything changes.

You can use an "offline Registry viewer":

http://www.gaijin.at/dlregview.php

http://72.14.221.132/translate_c?hl=en&amp...qSsTSebrDC2-Jsg

or an "offline Registry editor" (warning: EXPERIMENTAL/UNFINISHED):

http://www.boot-land.net/forums/?showtopic=4684

to check values of relevant Registry keys in the deployed image.

Or maybe you may want to try offlinesysprep :unsure::

http://www.911cd.net/forums//index.php?showforum=43

http://www.911cd.net/forums//index.php?showtopic=19397

jaclaz

Edited by jaclaz

Share this post


Link to post
Share on other sites

Thanks a lot. I will check these links to troubleshoot.

FYI

I have been using this image for restores previously. My first setup was running WinPE through a usb [d:] [without installing WiN PE on THE HARD DISK c:]. Disk 0 had just one partition which had WinXP installed. [Pre-requisite].

These were my steps

1. Boot [WAKE of lan (network booting)] using a usb which loaded WinpE on RAM.

2. Run a bat file which would copy Image1.wim into c: [Overwriting the Winxp installed ]

d:\imagex.exe /applye e:\Image.wim 1 c:

3. restart the machine using shutdown -r

The issue i faced is that when i restart, it boots from the USB again, thereby booting WINPE even though my boot order in the bios said "boot from the harddisk".

This is why i though i should have another partition which would contain WINPE, and using Wrex code i could change the bcd and restart my machine into Winxp.

one last question would be, In order to add bcd entrie, do i need to have a hard disk partition for WinPE?? or can i do it somehow just using the usb??

Thanks a lot.

Share this post


Link to post
Share on other sites
The issue i faced is that when i restart, it boots from the USB again, thereby booting WINPE even though my boot order in the bios said "boot from the harddisk".

This is why i though i should have another partition which would contain WINPE, and using Wrex code i could change the bcd and restart my machine into Winxp.

This one can easily be solved by using grub4dos on the USB stick/drive and exchange/omit to exchange (hd0) with (hd1).

See this for a quisck reference:

http://www.boot-land.net/forums/index.php?...c=2568&st=7

one last question would be, In order to add bcd entrie, do i need to have a hard disk partition for WinPE?? or can i do it somehow just using the usb??

Well no.

Basically you are simply editing a BCD store, it can be wherever you want, as long as it is on a writable filesystem (not on a CD/DVD or .iso).

Try opening the actual BCD store with RAWREG....

...it's simply a file for the boot loader. (though boot.ini is easier to edit :))

Check these:

http://www.multibooters.co.uk/bootmgr.html

http://www.multibooters.co.uk/cloning.html

Also, you can use "specialized" GUI programs:

http://www.vistabootpro.org/

http://neosmart.net/dl.php?id=1

jaclaz

Share this post


Link to post
Share on other sites

@chiraag,

Here is a screenshot of my bcdedit commands to set up a Dual-Boot-XP-WinPE from the Same Partition. bootsect and bcdedit are run from WinPE. The procedure starts with having no existing BCD on the HDD.

One error is highlighted - the /addlast command - which seems to require at least two boot entries (... logically ...).

The procedure following the Wrex batch does create entries in a different order to me, so the error may not apply. Nevertheless, it seems you are not getting the Boot Manager Screen, which indicates that the display order only has a single entry that is booted by default. (Perhaps that is what you want?)

DualBootBCDedit.gif

Regards

http://www.boot-land.net/forums/index.php?...ost&p=54593

http://technet.microsoft.com/en-us/library/cc721886.aspx

http://technet.microsoft.com/en-us/library/cc721886.aspx

Share this post


Link to post
Share on other sites

The Sysprep Windows XP image I install on D:\ was installed and sealed on D:\, so I don't think you can install and seal an image on C:\ and expect it to automatically adjust to work when you apply it to D:\. I suggest you either re-create your XP image or swap your partitions around so XP is on C:\ and PE is on D:\.

Share this post


Link to post
Share on other sites

Which partion is set as active?

I have a post on here where I accomplished this using the new Vista bootsector to boot between WinPE/WinRE and Windows XP.

I actually set the WinPE partition to be hidden so Windows XP was still set as C:\ and it was safe from the end users.

I created the Windows XP image on a PC with only one partition and was able to successfully deploy it to machines with WinPE on first and WinXP on second. I assume that as long as you're using the same drive letter and edit the boot.ini file accordingly, it should work.

Here's the script I use:

@ECHO OFF
SET CD=D:
SET RECVY=W:
SET WINXP=C:
SET REGUID=572BCD55-FFA7-11D9-AAE0-0007E994107D
REGEDIT -S VDS.REG
DISKPART -S PREPART.TXT
BOOTSECT.EXE /NT60 %RECVY%
BOOTSECT.EXE /NT52 %WINXP%
IMAGEX /APPLY BOOT.WIM 1 %RECVY%
IMAGEX /APPLY WINXPSP3.WIM 1 %WINXP%
START /WAIT WSCRIPT WIMHALDETECT.VBS
ATTRIB -R -H -S %WINXP%\NTLDR
ATTRIB -R -H -S %WINXP%\NTDETECT.COM
ATTRIB -R -H -S %WINXP%\BOOT.INI
COPY %WINXP%\NTLDR %RECVY%\
COPY %WINXP%\NTDETECT.COM %RECVY%\
COPY %WINXP%\BOOT.INI %RECVY%\
ATTRIB +R +H +S %RECVY%\NTLDR
ATTRIB +R +H +S %RECVY%\NTDETECT.COM
ATTRIB +R +H +S %RECVY%\BOOT.INI
DEL %WINXP%\NTLDR
DEL %WINXP%\NTDETECT.COM
DEL %WINXP%\BOOT.INI
MD %RECVY%\BOOT\
XCOPY %CD%\BOOT\*.* /E /F %RECVY%\BOOT\
COPY %CD%\BOOTMGR %RECVY%
DEL %RECVY%\BOOT\BCD
BCDEDIT -CREATESTORE %RECVY%\BOOT\BCD
BCDEDIT -STORE %RECVY%\BOOT\BCD -create {BOOTMGR} /d "Boot Manager"
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {BOOTMGR} DEVICE BOOT
BCDEDIT -STORE %RECVY%\BOOT\BCD -CREATE {NTLDR} /D "Windows XP"
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {NTLDR} DEVICE PARTITION=%WINXP%
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {NTLDR} PATH \ntldr
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {NTLDR} LOCALE EN-US
BCDEDIT -STORE %RECVY%\BOOT\BCD -create {%REGUID%} /D "Backup and Restore" -APPLICATION OSLOADER
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} OSDEVICE BOOT
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} DEVICE BOOT
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} PATH \windows\system32\boot\winload.exe
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} SYSTEMROOT \Windows
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} WINPE YES
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} DETECTHAL YES
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} NX OPTIN
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} CUSTOM:46000010 YES
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} LOCALE EN-US
BCDEDIT -STORE %RECVY%\BOOT\BCD -DEFAULT {NTLDR}
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {DEFAULT} RECOVERYSEQUENCE {%REGUID%}
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {DEFAULT} RECOVERYENABLED YES
BCDEDIT -STORE %RECVY%\BOOT\BCD -DISPLAYORDER {NTLDR} {%REGUID%}
BCDEDIT -STORE %RECVY%\BOOT\BCD -TIMEOUT 2
WPEUTIL REBOOT

Edited by TheReasonIFail

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...