Jump to content

DISKPART.EXE and Windows PE 2.0


Phurious

Recommended Posts

I have been digging around, and I have not seen any other post mentioning the issue I am running into; I am beginning to wonder if it is my OS. Here we go:

I am building a bootable USB PE 2.0 image. I have already created my custom boot.wim. Under Windows XP, when I use DISKPART.EXE to prepare the USB drive for use and then copy over my source files, the drive is unbootable. If I use a Windows PE 2.0 bootable CD-ROM and run DISKPART.EXE with the EXACT SAME script, and then copy over my source files the drive boots successfully.

Details:

60 GB External USB Drive

Below are my commands for DISKPART.EXE

select disk 1
clean
create partition primary
select partition 1
active
assign letter=f
exit

As I stated before, if I attempt to boot with the drive prepped with DISKPART.EXE under Windows XP I receive a error message that states "Remove disks or other media. Press any key to restart". The attached USB drive is the only external disk attached to the computer - no floppies or other bone-headed mistakes. If I boot using a drive prepped with DISKPART.EXE under Windows PE 2.0, the drive boots with no problems using the exact same BAT file to copy my source files. If I compare the drives side by side, the file structure is identical.

Can anyone tell me why I am running into this issue? I am aware they are 2 different versions of DISKPART.EXE for the different OS's, but I have verified that the drive setup under XP is set to active using PTEDIT, so I am at a loss.

Input? Anyone? Anyone? Bueller?

TIA

Link to comment
Share on other sites


Actually, mdolan got me on track. THANKS MDOLAN!!! :thumbup

Using BOOTSECT /nt52 C: Applies the master boot code that is compatible with NTLDR and not BOOTMGR; what I required was BOOTSECT /nt60 C:. That applies the master boot code that is compatible with BOOTMGR. In order to get this to work, all I had to do was copy the BOOTSECT.EXE from C:\Program Files\Windows AIK\Tools\PETools\x86 and dump it somewhere into my system's path. After that, I am able to edit the master boot code for either Vista or XP, under Windows XP, using the Bootsect Command-Line Options.

Thanks again for your help!

Edited by Phurious
Link to comment
Share on other sites

From my limited experience, it seems the bootsector needs to be written from a Vista machine. I have not yet found a solution to do this from Windows XP. Please correct me if I am wrong.

Bootsect.exe can be used on both WinXP, Win2003, WinPE and Vista.

Link to comment
Share on other sites

From my limited experience, it seems the bootsector needs to be written from a Vista machine. I have not yet found a solution to do this from Windows XP. Please correct me if I am wrong.

Bootsect.exe can be used on both WinXP, Win2003, WinPE and Vista.

I can run it from WinXP. It also appears to successfully write the bootsector from WinXP. But I cannot boot from it. If I run the same command from Vista, it works.

bootsect.exe /nt60 %_target%

<snip>

Writing MBR to "G:"...

Target volumes will be updated with BOOTMGR compatible bootcode.

G: (\\?\Volume{43bfceb3-99b5-11da-a40a-005056c00008})

Successfully updated FAT32 filesystem bootcode.

Bootcode was successfully updated on all targeted volumes.

</snip>

Link to comment
Share on other sites

nopants - Did you set the partition as active in DISKPART?

Can this be accomplished within WinXP? I am not able to manage USB key partitions within WinXP (to set as active).

But, if I go to WinPE 2.0 and mark the partition as active, I am still not able to successfully boot from the USB key.

If I run my entire script from within WinPE 2.0, I am able to get it to boot properly. I am still unable to from within WinXP.

Maybe I am missing something? The script just formats the USB key, runs bootsect /nt60, and copies the contents of the ISO directory down.

Link to comment
Share on other sites

nopants - Are you getting any specific error on boot? Download a copy of PTEDIT32 from here. You can run this under XP and see if the USB drive is set to active. Also, don't forget to include this line in your script:

xcopy C:\winpe_x86\mount\Windows\System32\Boot\*.* C:\winpe_x86\mount\Windows\System32\ /e /y

Link to comment
Share on other sites

nopants - Are you getting any specific error on boot? Download a copy of PTEDIT32 from here. You can run this under XP and see if the USB drive is set to active. Also, don't forget to include this line in your script:

xcopy C:\winpe_x86\mount\Windows\System32\Boot\*.* C:\winpe_x86\mount\Windows\System32\ /e /y

The error I get is:

Disk error

Press any key to restart

I copied the files from the Boot directory into the System32 directory as you indicate above. I was not doing this previously. I also ran PTEDIT32 and confirmed that the boot indicator for the partition on my usb key is set to '80' (it is the only partition).

Do I need to be formatting this differently? I am currently just running the normal XP format command:


format %_target% /fs:fat32 /u /v:usb
bootsect /nt60 %_target%
xcopy C:\WinPE_x86\ISO\*.* %_target%\*.* /s /e /v /y

Thanks alot for your help.

Link to comment
Share on other sites

What is the /u in your format command?

Have you tried running all these command manually first, and then adding them to the script/BAT file?

Try running the bootsect command below:

bootsect /nt60 %_target% /force

The /u command WAS for 'unconditional' which is a carry-over from the old DOS format command that my brain will not retire. /Q /BACKUP (also undocumented) will allow for an automated format... it seems. For kicks I tried the HP format utility to see if that would help. No luck.

I created all of this originally within Vista so was hoping to just plop my script on a WinXP machine and go. I tried running it manually now with no luck.

BTW, all my equipment is Dell (D610, GX270) and I have a Lexar JumpDrive. Old versions of WinPE boot fine on these machines when using the HP format utility.

I'm going to try to run some of these commands from both Vista and XP to nail down which one is failing when run from XP.

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