DiskPart exited with non-zero status (1). Aborting.
See original GitHub issueI’ve read through all the issues (closed and open) in GitHub and tried all the suggestions that I could, but unfortunately, I’m not able to get this to work. I’m running Windows 10 x64 1909 with all available updates installed. I’ve tried three different USB sticks from different manufacturers and different USB ports. I’ve tried running it as admin and letting the script self-elevate, but they all fail with the same error:
DiskPart exited with non-zero status (1). Aborting.
DiskPart codes look like it is simply saying it is a “fatal error.” However, I looked at the Python script, and it appears that it is trying to run the following block:
"select disk {}".format(disk.get("index",-1)),
"clean",
"convert mbr",
"create partition primary size=200",
"format quick fs=fat32 label='CLOVER'",
"active",
"create partition primary id=AB" # AF = HFS, AB = Recovery
Running these commands (without the comments and commas and such, obviously, and substituting the proper disk in the select statement) in diskpart itself works just fine and creates a drive that looks like the following, but the script seems to be having an issue with it, and unfortunately, I’m not good enough with Python to troubleshoot it further. Any ideas? Thanks for all the hard work on this!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
I appreciate you taking the time to look through this. I’ll see if there’s anything I can do to improve the pathing logic - and assigning a drive letter could likely be done in the script passed to
diskpart
when formatting.-CorpNewt
Could you test with the changes in this commit and see if that works better? I setup the path to diskpart using:
And adjusted the
diskpart.txt
script to contain the following (specifically the last 2 lines):-CorpNewt
Regarding the latest issue of “No partitions located on disk!”, it appears that Clover needs to have a drive letter assigned to the Clover partition, or the script will fail because the following two WMI commands will not find the partition without it:
I was able to bypass this by assigning a drive letter before the Clover step. I believe modifying the
diskpart
commands to assign a drive letter would likely fix the issue and would resolve #13, #23, #29, and #51 while changing the path logic should fix #25, #37, and #57.