Whenever you try deleting a protected partition using the Diskpart Command-line Interface (CLI), it will show an error message saying “Can’t delete a partition without the force protected parameter set.” It is a protection feature on Windows that prevents accidental deletion of the drives that are essential to run the operating system.
The protected partitions where this feature applies include:
You can check for the type of partition in Disk Management (diskmgmt.mscon Run) and go to the relevant solution if you really need to delete this partition.
If the partition doesn’t fit any criteria or is only a basic data partition, it is likely a heavily corrupted partition or a corrupted disk. In such cases, you can either try clearing the whole disk and then formatting it. If it still doesn’t resolve the issue, you need toreplace the diskaltogether.
Use Override Attribute With Delete Partition
It is possible to delete the recovery partition through Diskpart. However, you need to use the parameteroverrideto force the deletion. The complete process goes like this:
Change Pagefile Location
If you try deleting the current pagefile partition on Diskpart, even with the override function, you’ll get the message- “Delete is not allowed on the current boot, system, pagefile, crashdump, or hibernate volume.” But you’ll also get the same message if the partition is the boot or system volume. So, first, try checking whether it is the pagefile partition or not.
The pagefile partition stores apagefile.sysfile that reserves the space your system uses as virtual memory. It is a hidden OS file, so you should first unhide all protected system files.
Then, open that partition or drive through your file explorer and see if you’re able to see thepagefile.sysfile there. If so, you need to change its location so that you can delete the partition.
Change Boot Partition
Now, you need to check whether the partition of your partition is the boot partition. You can do so from the Disk Management utility.
If the partition with the bootloader exists on the same disk as the OS, don’t try deleting it as it is an essential partition. If it exists on another disk and there is no other boot partition, you need to create a new boot partition on your primary disk to be able to delete this partition.
To create an EFI partition on a GPT disk:
To create a legacy boot partition on an MBR disk:
After that, try deleting the old boot partition on the other disk.
Clear Whole Disk
If you are trying towipe the entire drive, you can use the clean command in diskpart to remove all contents of the drive including the protected partition. Also, if you have more than one boot partition on two separate disks, then you may need to clear the whole disk to delete that partition.