Windows 8

Makewinpemedia Diskpart Format ErrorLevel -2147212243

Learn about the 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

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

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_x86media*.* /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 makewinpemedia command from the deployment environment command prompt, manually creating the disk may be the best option.

Subscribe to VirtualizationHowto via Email 🔔

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

4 Comments

  1. Encountered this same problem today. After digging deeper, it was because I was using too large a thumb drive for fat32 (coincidentally I am also using a 64GB Kingston USB stick). I merely edited the makewinpemeda.cmd (located in c:program files (x86)Windows Kit8.1Assessment and Deployment KitWindows Preinstallation Environment folder).

    Old Line: echo format fs=fat32 label=”WinPE quick >> “%DISKPARTSCRIPT%”
    New Line: echo format fs=ntfs label=”WinPE quick >> “%DISKPARTSCRIPT%”

  2. This error only happens when your usb/drive are in GPT format. all you have to do is convert it to mbr and run MakeWinPEMedia command again.

    1. Lapizman,

      Thank you for your comment, makes sense. It would be great if Microsoft would build in a proactive check for this as the error isn’t intuitive. Great to note this along with the workaround.

      Thanks again,
      Brandon

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.