Makewinpemedia Diskpart Format ErrorLevel -2147212243

In working with Windows 8.1 WADK in a client environment recently, the need arose to create a USB key to boot from for PE environment on a workstation.  There is a new command in the WADK Deployment and Imaging Tools environment that allows one to easily create a bootable USB key to use to initialize the PE environment – makewinpemedia
wadk_02-300x151 Makewinpemedia Diskpart Format ErrorLevel -2147212243
Steps normally used to create the USB key:
Below, you will substitute the drive letter your USB key is mounted to.  All commands are issued from the tool launched as administrator.

 For 64 bit:
 Copype amd64 C:\winpe_amd64
 For 32bit:
 copype x86 c:\winpe_x86
 Creating the key:

 makewinpemedia /ufd c:\winpe_x86 m:
 makewinpemedia /ufd /f c:\winpe_x86 m:
Issue and Resolution:
In using a new USB key that I had recently bought to sneakernet files around, I received the error:  diskpart format errorlevel -2147212243 after entering the makewinpemedia command.  The USB key was a new 64gig Kingston key that worked perfectly fine in all other situations.  I had a hunch though that it could be the size of the key that diskpart was having issues with.  The idea after this being that hopefully I could create the USB key manually and avoid the issue I was running into using the makewinpemediacommand.
Steps to manually create the USB key partition and file structure using diskpart:

diskpart 
select disk 1 
clean 
create partition primary size=10240 
select partition 1 
active 
format fs=fat32 
assign 
exit

This sets up a 10 gig partition on the key and formats it using FAT32.  Then all that is left to do is manually copy the files that you created when running the copype command mentioned above.  Below you would use the drive letter of your actual USB drive in Windows. 

xcopy c:\winpe_x86\media\*.* /s /e /f f:\
Final Thoughts
That is it!  After manually creating the partition and file system on the USB key manually and then copying the files over to the drive using XCOPY, I was able to boot from the USB key without issue.  So, if you run into this weird diskpart error when trying to use the makewinpemediacommand from the deployment environment command prompt, manually creating the disk may be the best option.

Post a Comment

6 Comments

  1. I also had similar problem. The problem was that MakeWinPEMedia cannot work with gpt flash drives. After I converted my flash drive from gpt to mbr, then MakeWinPEMedia could format it correctly.

    ReplyDelete
    Replies
    1. I second that, thank you!!

      MakeWinPEMedia now works perfectly for MBR drives.

      Delete
  2. I followed your steps, but USB does not boot, shows as invalid partition

    ReplyDelete
  3. Got fixed, in your blog update, when selecting Boot, choose USB UEFI Boot.

    ReplyDelete
  4. booting from USB in UEFI mode, mbr2gpt command does not return no value.

    ReplyDelete