Maelstorm Posted August 24, 2009 Posted August 24, 2009 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 PEHere's what I have tried:In boot.ini, copy the WinXP line and modify it to point to D:\i386 :--: FailedInstalled cmdcons, copied bootsect.dat to D: and point to that in boot.ini :--: FailedPoint to D:\i386\setupldr in boot.ini :--: FailedPoint to D:\i386\ntldr in boot.ini :--: FailedCopy ntldr to d:\ and point to that :--: Failed I'm out of ideas. 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.
cdob Posted August 24, 2009 Posted August 24, 2009 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.htmlWinPE 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:\ntldrAnd copy d:\minint\ntdetect.com to d:\ntdetect.com.
Maelstorm Posted August 25, 2009 Author Posted August 25, 2009 (edited) 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 August 25, 2009 by Maelstorm
Tripredacus Posted August 25, 2009 Posted August 25, 2009 Take a look at Terabyte Unlimited's website. They have some freeware utilities that may be useful to you.http://www.terabyteunlimited.com/downloads-free-software.htm
Maelstorm Posted August 25, 2009 Author Posted August 25, 2009 (edited) 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 August 25, 2009 by Maelstorm
cdob Posted August 25, 2009 Posted August 25, 2009 Can you recommend a command-line sector extractor so I can extract the boot sector of the partition?Something like mkbt.exeWhy don't you use mkbt.exe? http://www.nu2.nu/mkbt/Besides there is dd. E.g. http://www.chrysocome.net/dddd if=//./x: of=c:/bootsector count=1dsfok http://members.ozemail.com.au/~nulifetv/freezip/freeware/and bootpart http://www.winimage.com/bootpart.htmhttp://www.msfn.org/board/index.php?s=&...st&p=400021In addition: D: has to be a primary partition.
Maelstorm Posted August 26, 2009 Author Posted August 26, 2009 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.
cdob Posted August 26, 2009 Posted August 26, 2009 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=16mkbt 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.
Maelstorm Posted August 26, 2009 Author Posted August 26, 2009 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.
jaclaz Posted August 26, 2009 Posted August 26, 2009 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.datordsfo \\.\d: 0 8192 c:\0\partition-sectors.datjaclaz
Maelstorm Posted August 26, 2009 Author Posted August 26, 2009 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.DATSo 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 OFFSTART /WAIT CMD.EXE /C "\Program Files\Misc\PrepDisk.cmd"START /WAIT CMD.EXE /C "\Program Files\Misc\Install.cmd" vol1uSTART /WAIT CMD.EXE /C "\Program Files\Misc\Recover.cmd"EXITPrepDisk.cmd@ECHO OFFdiskpart /s "\Program Files\Misc\DiskPart.ini"ECHO.format c: /q /y /fs:ntfs /v:Systemformat z: /q /y /fs:ntfs /v:RecoveryInstall.cmd@ECHO OFFREM SetupSET PARAM=%1SET TARGET=C:REM Parameter CheckIF /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:PROGRAMREM Final SetupSET SOURCEFILES=X:\WINXP\%SOURCE%\I386SET 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 /YGOTO :EXIT:ERRORECHO.ECHO Code Ed IM KeyECHO ============================================ECHO MCE1U Media UAECHO MCE1A Media AECHO MCE2U Media UAECHO MCE2A Media AECHO OEM1U OEM UAECHO OEM1A OEM AECHO RTMU1U Retail UAECHO RTMU1A Retail AECHO RTMU2U Retail UAECHO RTMU2A Retail AECHO VOL1U Volume UAECHO VOL1A Volume AECHO TESTU Volume UAECHO TESTA Volume AECHO.GOTO :EOF:EXITGOTO :EOFRecover.cmd@ECHO OFFREM install recovery partitionECHO Build DirectoriesMKDIR "Z:\MININT"MKDIR "Z:\Program Files"ECHO Copy DataXCOPY /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 BootECHO.MKBT -x -v -c Z: C:\BOOTREC.DATDiskPart.iniselect disk 0cleancreate partition primary size=40960select partition 1activeassign letter=C:select disk 0create partition primaryselect partition 2assign letter=Z:
jaclaz Posted August 27, 2009 Posted August 27, 2009 Just for the record and FYI, you can also "embed" diskpart commands inside the batch:http://www.msfn.org/board/updated-aug-6-20...69-page-19.htmljaclaz
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now