Jump to content

Using WinPE from a fob to setup a dual-boot of WinPE and WinXP


Avin

Recommended Posts

Hi all,

I have read several threads on instructions for dual-booting WinPE and WinXP, and I successfully have been able to reproduce getting WinPE to dual boot with WinXP Home (by installing the Recovery console and then copying the Minint folder and Bootsect.dat, and editing the boot.ini).

I have a USB flash drive that boots into Win PE. I want to be able to run a .bat file (or executable if need be) from within this instance of WinPE that will:

1. Create two partitions on the single hard drive, clean them, and format them

2. Copy over the necessary files so that when I next reboot, I will be able to select between WinXP and WinPE both booting from seperate partitions on the hard drive. The partition with WinPE on it needs to be the active partition.

So after I got WinPE and XP dual booting from C as mentioned above, I copied the root contents of the C drive and minint folder onto the fob in a seperate location from the WinPE files already there. Then once booting into WinPE from the fob, I used diskpart to clean and then partition the hard drive, then format them and copy the files I had copied onto the fob into the C drive, which I had set as the active partition.

Now when I restart, I get the same boot menu I had gotten before from when I had XP and PE dual booting successfully, and XP rightly fails to load because I never reinstalled it, but PE does not either: I get the error message that it couldn't find ntldr. Yet ntldr is indeed still present on the C drive (the XP version of ntldr, not the PE version, as I noted they were different). I had thought that it was ntldr that loaded the boot.ini to begin with, am I mistaken? At any rate, how do I get it to recognize the ntldr that is present? Does the file need to be on a specific sector of the hard drive? What can I use to put it there?

Thanks,

Avin

Link to comment
Share on other sites


I had thought that it was ntldr that loaded the boot.ini to begin with, am I mistaken?

No, you are right, but maybe you missed something.

The NTLDR (the real one) will parse boot.ini and, based on user selection, will invoke ntdetect.com to boot if a NT/2K/XP/2003 has been chosen or simply pass control to a bootsector.

The "PE" NTLDR (actually SETUPLDR.BIN renamed to NTLDR) will read WINNT.SIF and boot whatever is specified there.

See also my posts here:

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

If I get right your original setup, you had in boot.ini an entry like:

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

that booted XP, and one like:

C:\bootsect.dat="Windows PE"

Since the boosect.dat is actually a bootsector, it will try to load another NTLDR.

So you have now a situation where the data in the bootsector, which contains partition information, is no more correct (since you changed partition size), and thus it cannot find the file.

The use of GRLDR is very convenient, but if you want, it is possible to fix the problem in some other way.

I need to understand how your original setup was made, and how your hard disk is currently formatted if it is FAT16 or 32, recreating a bootsector is very convenient using bootpart, then you can rename setupldr.bin to (for example) PELDR and hexedit the bootsector accordingly....

Or, you can use, even from batch a combination of dsfo and gsar to copy your current bootsector to a file, then sustituting in it "NTLDR" wit "PELDR"....

jaclaz

Link to comment
Share on other sites

Thanks for the response.

Theoretically, the partitioning should have been the same before as it was afterwards. I had a primary partition © that was 4000 MB and another primary partition (D) that took up the rest of the 40 GB disk.

I don't believe I did so, but if I change the letters assigned to the partitions, does that affect the bootsect.dat?

Link to comment
Share on other sites

No, letters are "software" assigned, there is no difference in the bytes in MBR and/or bootrecord.

The "theoretically" when coupled to "4000 Mb" leaves some doubts in my mind.

Each partitioning/formatting utility, expecially windows GUI ones, have their own way of counting bytes....

Just one sector (512 bytes) shift will make the "old" Bootsect.dat not working, IF this is the problem.

Unless you post some more details on the steps you took, I am not even sure that THIS is the problem.

jaclaz

Link to comment
Share on other sites

Ok, here is what I've got in more detail:

I have two fobs. One that cleans and installs Windows XP, running the following diskpart script first:

Select disk 1

Clean

REM create recovery partition

Create partition primary size = 4000

Active

Assign letter = D

REM create main partition

Create partition primary

Assign letter = C

Exit

The second fob contains a bootable image of WinPE (exactly the same as the first), except that it doesn't automatically install Windows XP - in fact it just goes into WinPE and gives you a prompt. I just took the same files from the first fob and modified the winbom.ini.

What I did was I booted using the first fob, which installed WinXP (Home edition, by the way) onto the second partition ©, and then once I booted into that XP installation I installed the Recovery console and copied the minint folder, and winbom.ini off the fob onto C. I rebooted and that was when I experienced the working dual boot of winPE and XP off that hard drive. So then I copied the boot.ini, ntldr, bootsect.dat, and minint folder that was on the hard drive onto a subfolder (called "backup") on the second fob. My goal now is to use only the second fob to get the hard drive configured with the same partitions, however with the first partition set as the active partition, not the second.

So I booted using the second fob, and once in WinPE I ran the same script as above, although I omitted the "assign letters" because I didn't think that mattered - I guessed what you confirmed, that the letters were only relevent to the software. I reformatted both new partitions and copied the contents of the backup folder to the first partition, which is also now C. So the same ntldr is there from the XP home installation, the same bootsect.dat, the same boot.ini, and the minint folder is the same.

Does setting one partition to be active versus the other affect the bootsect.dat? That is another thing that would have changed.

Do I need to have the PE ntldr? I don't think I actually had it on the hard drive before, when I had the dual boot working, so I figured it was unnecessary.

Here is the contents of the boot.ini, by the way:

[boot loader]

timeout=10

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

[operating systems]

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

C:\BOOTSECT.DAT="Microsoft Windows PE"

Link to comment
Share on other sites

Alright, I've resorted to splitting the aforementioned drive into three partitions now, one with XP one with PE and the third with Linux, all booting from Grub on the MBR (and all work!). The Linux partition is not even used, and in fact I removed it from the boot menu, but I put it on so I could get Grub installed. This seems to solve my problems although it's a crazy approach : now I have three operating systems, the second is only for recovery, and the third I don't even want. But I guess it's sufficient for me.

If you have any advice on why the setup in my above post wasn't working or how I could get it to, let me know. I might still consider switching back.

Link to comment
Share on other sites

What I would do:

1) Get GRUB4DOS

http://grub4dos.jot.com/

2) Add GRLDR to your standard Setup

Some references:

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

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

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

This way you will have BOTH the possibility to use standard MBR/NTLDR/BOOT.INI and the GRUB features.

jaclaz

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...