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. 


Sign in to follow this  
Maelstorm

Boot WinPE 1.x from second partition?

Recommended Posts

How do you boot Windows PE 1.x (I'm using 1.6) from a second primary partition or harddisk using boot.ini? I've tried several things, but have yet to get it working correctly. Note that this isn't a dual-boot of WinPE in the same partition as WinXP, but it's in a different partition/drive. Here's the layout:

Harddrive 0:

Part 1: ~475GB Primary/Active - Windows XP

Part 2: ~20GB Primary - Windows PE

Here's what I have tried:

In boot.ini, copy the WinXP line and modify it to point to D:\i386 :--: Failed

Installed cmdcons, copied bootsect.dat to D: and point to that in boot.ini :--: Failed

Point to D:\i386\setupldr in boot.ini :--: Failed

Point to D:\i386\ntldr in boot.ini :--: Failed

Copy ntldr to d:\ and point to that :--: Failed

:blink: I'm out of ideas. :wacko:

Do you guys have any?

I'm getting desperate to get this to work as this is the final hurdle that I need to cross.

Share this post


Link to post
Share on other sites

Format partition d: using windows default tools.

Extract the boot code from partiton d: to a file.

Copy this file to c:\. This has to be the same hard disk.

Add this file to c:\boot.ini.

http://www.msfn.org/board/boot-pe-hard-drive-t53366.html

WinPE 1.x use directory \minint at hard disk.

Copy \I386 to \minint.

Boot sector file launch file d:\ntldr: copy d:\minint\setupldr.bin to d:\ntldr

And copy d:\minint\ntdetect.com to d:\ntdetect.com.

Share this post


Link to post
Share on other sites

Ah, so that's what the problem is.

Can you recommend a command-line sector extractor so I can extract the boot sector of the partition? I don't have any tools to do that for hard disks. I've searched all over google, and I did find a couple of tools that would seem to work, but they do not. Something like mkbt.exe from BartPE would be just the ticket that I am looking for.

Edited by Maelstorm

Share this post


Link to post
Share on other sites

Those tools are nice, but not what I am looking for. I need a tool that will read the MBR, then write the specified volume boot record to a file. Just like WINNT32.exe does when you install the Recovery Console. It makes a file called BOOTSECT.DAT in the cmdcons directory of the boot partition. I'm looking at writing my own, but I would rather not as I know absolutely nothing about C/C++ programming under Windows.

-EDIT-

I did find a tool called Findpart http://www.partitionsupport.com/utilities.htm that does what I want, but it's a 2 step process to make this work. The problem is getting the start CHS data out of the list and into the command line for the getsect command.

Edited by Maelstorm

Share this post


Link to post
Share on other sites
Can you recommend a command-line sector extractor so I can extract the boot sector of the partition?

Something like mkbt.exe

Why don't you use mkbt.exe? http://www.nu2.nu/mkbt/

Besides there is dd. E.g. http://www.chrysocome.net/dd

dd if=//./x: of=c:/bootsector count=1

dsfok http://members.ozemail.com.au/~nulifetv/freezip/freeware/

and bootpart http://www.winimage.com/bootpart.htm

http://www.msfn.org/board/index.php?s=&amp...st&p=400021

In addition: D: has to be a primary partition.

Share this post


Link to post
Share on other sites

Ok, I think we have a misunderstanding of what I am asking for. I did get this to work, manually, but I need a automatic method to do this. I'm not asking for the Master Boot Record, but the *VOLUME* Boot Record. The MBR that we all know and love is at CHS 0, 0, 1. This everybody knows about, and all the tools and suggestions given deal with that, except mkbt which gives an error about it only works with floppies. What I'm asking for is the boot sector *INSIDE* the partition that is pointed to by the MBR. That's what BOOTSECT.DAT is when you install the Recovery Console. The volume boot record for the first partition is at LBA sector 64 for Windows XP installations (At least all the ones that I have seen), which is the start of the first parition of the drive. The boot code that loads ntldr on NTFS volumes starts there and spans 16 disk sectors for 8Kb of data. It is referenced as $Boot in the MFT, but there's no way that I'm aware of to get at it.

Share this post


Link to post
Share on other sites
OK, I think we have a misunderstanding of what I am asking for.

All mentioned tools can handle the partition boot record, hence the *VOLUME* Boot Record.

I did NOT recommend the MBR so far.

E.g. dd if=//./x: read data from partition x:. Partition x: start with the volume boot record.

If you like first 16 sectors from partition d:, you have to set count=16.

dd if=//./d: of=c:/bootsector count=16

mkbt which gives an error about it only works with floppies.

http://www.nu2.nu/mkbt/

Usage:

mkbt [switches] <source> <target>

<source> The source file/drive which contains the bootsector to install

<target> The target file/drive to install the bootsector on

Switches: -v Verbose mode

-c Copy mode (no install) used for copying the bootsector(s)

-x Expert mode (do not check drive A or B only)

USE WITH CAUTION!

-l=<xxx> Set Volume Label to <xxx>

What about using expert mode?
That's what BOOTSECT.DAT is when you install the Recovery Console.
BOOTSECT.DAT is edited in addition, the string ntldr is changed to cmldr.
The volume boot record for the first partition is at LBA sector 64 for Windows XP installations (At least all the ones that I have seen), which is the start of the first parition of the drive.
Yes, it's often LBA 64, given often a 63 sectors mapping is used.

However, most likely it's another LBA for second partition at first hard disk.

Share this post


Link to post
Share on other sites

My brain went for a walk on that post. Heh, this entire thread actually. I think dd would be the best tool to use in this case since that is the tool that I am most familiar with. I'll play around with it and see if I can get an automated setup working. Thank you so very much for the help.

Share this post


Link to post
Share on other sites

If you want to give some rest to your brain, use a GUI app.

HDhacker:

http://dimio.altervista.org/eng/

I personally like dsfo (part of the dsfok toolkit) better than dd:

dsfo \\.\d: 0 512 c:\0\partition-sectors.dat

or

dsfo \\.\d: 0 8192 c:\0\partition-sectors.dat

jaclaz

Share this post


Link to post
Share on other sites

I have an update. It turns out that dd does not work under WinPE 1.5/1.6. So, I tried one of the other tools mentioned, specifically mkbt. It seems the following command line works quite well:

mkbt -x -v -c Z: C:\BOOTREC.DAT

So I've integrated it into my boot disk. This is all strictly testing right now. I am currently writing a HTA menu system that will run under WinPE to control everything based on what the user selects.

As for testing, the following is the batch files that I am using to do this with under VMWare 5.5:

MakeDisk.cmd

@ECHO OFF
START /WAIT CMD.EXE /C "\Program Files\Misc\PrepDisk.cmd"
START /WAIT CMD.EXE /C "\Program Files\Misc\Install.cmd" vol1u
START /WAIT CMD.EXE /C "\Program Files\Misc\Recover.cmd"
EXIT

PrepDisk.cmd

@ECHO OFF

diskpart /s "\Program Files\Misc\DiskPart.ini"
ECHO.
format c: /q /y /fs:ntfs /v:System
format z: /q /y /fs:ntfs /v:Recovery

Install.cmd

@ECHO OFF

REM Setup
SET PARAM=%1
SET TARGET=C:

REM Parameter Check
IF /I "%1"=="MCE1U" (
SET SOURCE=MCE
SET CONFIG=mce1u.txt
GOTO :PROGRAM
)
IF /I "%1"=="MCE1A" (
SET SOURCE=MCE
SET CONFIG=mce1a.txt
GOTO :PROGRAM
)
IF /I "%1"=="MCE2U" (
SET SOURCE=MCE
SET CONFIG=mce2u.txt
GOTO :PROGRAM
)
IF /I "%1"=="MCE2A" (
SET SOURCE=MCE
SET CONFIG=mce2a.txt
GOTO :PROGRAM
)
IF /I "%1"=="RTM1U" (
SET SOURCE=RTM
SET CONFIG=rtm1u.txt
GOTO :PROGRAM
)
IF /I "%1"=="RMT1A" (
SET SOURCE=RTM
SET CONFIG=rtm1a.txt
GOTO :PROGRAM
)
IF /I "%1"=="RTM2U" (
SET SOURCE=RTM
SET CONFIG=rtm2u.txt
GOTO :PROGRAM
)
IF /I "%1"=="RTM2A" (
SET SOURCE=RTM
SET CONFIG=rtm2a.txt
GOTO :PROGRAM
)
IF /I "%1"=="OEM1U" (
SET SOURCE=OEM
SET CONFIG=oem1u.txt
GOTO :PROGRAM
)
IF /I "%1"=="OEM1A" (
SET SOURCE=OEM
SET CONFIG=oem1a.txt
GOTO :PROGRAM
)
IF /I "%1"=="VOL1U" (
SET SOURCE=VOL
SET CONFIG=vol1u.txt
GOTO :PROGRAM
)
IF /I "%1"=="VOL1A" (
SET SOURCE=VOL
SET CONFIG=vol1a.txt
GOTO :PROGRAM
)
IF /I "%1"=="TESTU" (
SET SOURCE=VOL
SET CONFIG=MasterUnattended.txt
GOTO :PROGRAM
)
IF /I "%1"=="TESTA" (
SET SOURCE=VOL
SET CONFIG=MasterAttended.txt
GOTO :PROGRAM
)
GOTO :ERROR


:PROGRAM
REM Final Setup
SET SOURCEFILES=X:\WINXP\%SOURCE%\I386
SET CONFIGFILES=x:\WINXP\CONFIG\%CONFIG%
CHDIR %SOURCEFILES%
IF /I "%SOURCE%"=="MCE" (
WinNT32 /syspart:%TARGET% /s:%SOURCEFILES% /unattended:%CONFIGFILES% /makelocalsource:all /copysource:lang /dudisable
) ELSE (
WinNT32 /syspart:%TARGET% /s:%SOURCEFILES% /unattended:%CONFIGFILES% /makelocalsource /copysource:lang /dudisable
)
ECHO.
XCOPY %SystemDrive%\WINXP\OEMFILES C:\$WIN_NT$.~LS\$OEM$ /S /E /Q /Y
GOTO :EXIT


:ERROR
ECHO.
ECHO Code Ed IM Key
ECHO ============================================
ECHO MCE1U Media UA
ECHO MCE1A Media A
ECHO MCE2U Media UA
ECHO MCE2A Media A
ECHO OEM1U OEM UA
ECHO OEM1A OEM A
ECHO RTMU1U Retail UA
ECHO RTMU1A Retail A
ECHO RTMU2U Retail UA
ECHO RTMU2A Retail A
ECHO VOL1U Volume UA
ECHO VOL1A Volume A
ECHO TESTU Volume UA
ECHO TESTA Volume A
ECHO.
GOTO :EOF

:EXIT
GOTO :EOF

Recover.cmd

@ECHO OFF

REM install recovery partition
ECHO Build Directories
MKDIR "Z:\MININT"
MKDIR "Z:\Program Files"
ECHO Copy Data
XCOPY /S /E /Q /Y "X:\I386" "Z:\MININT"
XCOPY /S /E /Q /Y "X:\Program Files" "Z:\Program Files"
COPY "Z:\MININT\ntdetect.com" "Z:\"
COPY "Z:\MININT\setupldr.bin" "Z:\ntldr"
ECHO Install Boot
ECHO.
MKBT -x -v -c Z: C:\BOOTREC.DAT

DiskPart.ini

select disk 0
clean
create partition primary size=40960
select partition 1
active
assign letter=C:
select disk 0
create partition primary
select partition 2
assign letter=Z:

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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...