When trying to delete D: partition (C: containing system, select volume 1 + delete volume override) I get error from diskpart:
Delete is not allowed on the current boot, system, pagefile,crashdump or hibernation volume.While the partition is represented as Healthy (no system, active, page file, etc. indicators in disk management console) I don't care too much for the reason. Is there any way to delete this partition from command line while windows is running (using diskpart or any other tool)? I don't care for the change to be visible immediately as next command in my script is shutdown. The only thing I am trying to accomplish here is to prevent the need to boot in Linux to do a simple operation of removing a partition.
34 Answers
I had the same issue. In my case, it was caused by a paging file being manually configured on the D: partition. After removing the paging file and rebooting, Remove-Partition ran without issue in PowerShell.
None of these 2 answers work for me. I spent hours on this and the best and one-shot solution for this is to:
Install a Windows PE on your USB and boot from USB. Then launch a terminal/prompt there and use diskpart as the OP mentioned to delete anything you want.
Turn off your computer then put it into recovery mode I have an hp note book which means I push f10 on boot then go to advanced then command prompt then type diskpart then type select disk 0 then type clean success done😁
I had the same problem and neither diskpart nor Power Shell Remove-Partition worked.
I was able to remove the partition using MiniTool Partition Wizard.