I've been experiencing an odd problem with Diskpart lately, wondering if anyone else is seeing this. It's really easy to reproduce.
Steps to Reproduce
==================
Plug in a thumb drive
Run diskpart
Within diskpart run the following commands (in my example, my thumb drive is disk 2). Be careful as this will erase the selected drive!:
list disk
select disk 2
clean
DiskPart has encountered an error: A device which does not exist was specified.
See the System Event Log for more information.
DISKPART>
If I look in event viewer, I see this message:
Cannot zero sectors on disk \\?\PhysicalDrive2. Error code: 1B1@0101000F
More Information
================
First, note that the above error happens ONLY if the thumb drive is configured for MBR. It will NEVER happen when it is GPT.
Second, my initial workaround was to simply issue the "clean" command again. Probably about 90% of the time, a second run of the command will work. However, I have had times in a batch file where it does not succeed, maybe due to the short time between the two commands. I have a program as well as several batch files that have a need for this to be rock stable.
I have a new workaround that seems to be working 100% for me, but it's stupid that I need to even employ such a workaround.
The new workaround is like this:
list disk
select disk 2
clean
convert gpt
clean
convert gpt
clean
convert mbr
The idea of the above series of commands is to try and perform a clean 3 times. Since we know that it never fails when GPT is used, after each clean we do a "convert gpt". By doing so, if we had a successful clean operation, we can guarantee that the next clean will not fail because we are now in GPT mode. Now, we are in a known good state, so we can do a final "convert mbr" successfully. The end result is a successfully cleaned disk using MBR.
I only just converted a system back to windows 10 so I have not been able to test to see if this happens on Windows 10. I plan to try it this evening. However, it's happening frequently on my Win 11 machines. Note that all my Win 11 machines are on the latest Feb 2022 Windows patches.
Has anyone else been noticing this? I can't swear how long this happening, but I became very aware of it in the last few weeks, definitely before the Feb patches rolled out.
Steps to Reproduce
==================
Plug in a thumb drive
Run diskpart
Within diskpart run the following commands (in my example, my thumb drive is disk 2). Be careful as this will erase the selected drive!:
list disk
select disk 2
clean
DiskPart has encountered an error: A device which does not exist was specified.
See the System Event Log for more information.
DISKPART>
If I look in event viewer, I see this message:
Cannot zero sectors on disk \\?\PhysicalDrive2. Error code: 1B1@0101000F
More Information
================
First, note that the above error happens ONLY if the thumb drive is configured for MBR. It will NEVER happen when it is GPT.
Second, my initial workaround was to simply issue the "clean" command again. Probably about 90% of the time, a second run of the command will work. However, I have had times in a batch file where it does not succeed, maybe due to the short time between the two commands. I have a program as well as several batch files that have a need for this to be rock stable.
I have a new workaround that seems to be working 100% for me, but it's stupid that I need to even employ such a workaround.
The new workaround is like this:
list disk
select disk 2
clean
convert gpt
clean
convert gpt
clean
convert mbr
The idea of the above series of commands is to try and perform a clean 3 times. Since we know that it never fails when GPT is used, after each clean we do a "convert gpt". By doing so, if we had a successful clean operation, we can guarantee that the next clean will not fail because we are now in GPT mode. Now, we are in a known good state, so we can do a final "convert mbr" successfully. The end result is a successfully cleaned disk using MBR.
I only just converted a system back to windows 10 so I have not been able to test to see if this happens on Windows 10. I plan to try it this evening. However, it's happening frequently on my Win 11 machines. Note that all my Win 11 machines are on the latest Feb 2022 Windows patches.
Has anyone else been noticing this? I can't swear how long this happening, but I became very aware of it in the last few weeks, definitely before the Feb patches rolled out.
My Computers
System One System Two
-
- OS
- Win11 Pro 22H2, Moment 2
- Computer type
- PC/Desktop
- Manufacturer/Model
- Home Built
- CPU
- Intel i7-11700K
- Motherboard
- ASUS Prime Z590-A
- Memory
- 128GB Crucial Ballistix 3200MHz DRAM
- Graphics Card(s)
- No GPU - CPU graphics only (for now)
- Sound Card
- Realtek (on motherboard)
- Monitor(s) Displays
- HP Envy 32
- Screen Resolution
- 2560 x 1440
- Hard Drives
- 1 x 1TB NVMe Gen 4 x 4 SSD
1 x 2TB NVMe Gen 3 x 4 SSD
2 x 512GB 2.5" SSDs
2 x 8TB HD
- PSU
- Corsair HX850i
- Case
- Corsair iCue 5000X RGB
- Cooling
- Noctua NH-D15 chromax.black cooler + 10 case fans
- Keyboard
- CODE backlit mechanical keyboard
- Mouse
- Logitech MX Master 3
- Internet Speed
- 1Gb Up / 1 Gb Down
- Browser
- Chromium Edge
- Antivirus
- Windows Defender
- Other Info
- Additional options installed:
WiFi 6E PCIe adapter
ASUS ThunderboltEX 4 PCIe adapter
-
- Operating System
- Win11 Pro 22H2, Moment 2
- Computer type
- Laptop
- Manufacturer/Model
- HP Spectre x360 15-BL012DX
- CPU
- Intel i7-7500U
- Memory
- 32GB
- Graphics card(s)
- Dual Intel HD 620 and Nvidia GeForce 940MX
- Sound Card
- Built-in Realtek HD Audio
- Monitor(s) Displays
- 4k 15-inch
- Screen Resolution
- 4k (3840 x 2160)
- Hard Drives
- 1TB Seagate FireCuda 510 NVMe SSD
- Internet Speed
- 1Gb Up / 1Gb Down
- Browser
- Chromium Edge
- Antivirus
- Windows Defender
- Other Info
- RAM Upgraded from 16GB to 32GB WiFi Upgraded from WiFi 5 to WiFi 6 SSD upgraded from 512GB NVMe SSD to 1TB Seagate FireCuda 510 NVMe SSD