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
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.
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%”
fs=exFAT works too.
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.
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