Many users receive the “Clean is not allowed on the disk Virtual Disk Service error” when using DiskPart. Are you also troubled by the error? Don’t worry. This post from MiniTool explores 3 simple methods to help you clean a hard disk.
DiskPart is a Windows built-in disk and partition manager that can be used to clean disks, extend/create/delete partitions, etc. However, this utility often runs into various errors, such as “Virtual Disk Service error: the operation timed out”, “Virtual Disk Service error the object is not found”, and the one discussed here.
Clean is not allowed on the disk containing the current boot. I've got a secondary HDD that has nothing to do with the current boot of Windows, but it had the Windows installation files on it. I want to clean the disk using DiskPart but it gives me the following error: Virtual Disk Service error: Clean is not allowed on the disk.https://www.reddit.com/r/techsupport/comments/arp6be/clean_is_not_allowed_in_the_disk_containing_the/
What causes the “clean is not allowed on the disk Virtual Disk Service error”? As the error message suggests, the main reason for the error is that the hard disk contains the boot system, pagefile, or hibernation volume. Once you cleaned them, Windows will run into disorder and be unbootable. So, how to fix it if clean is not allowed on the disk Virtual Disk Service error? Let’s try the following 3 methods.
Way 1. Delete All Partitions Using MiniTool Partition Wizard
As you know, the DiskPart clean command will delete all partitions on the target disk. Is there a tool to delete all partitions on Windows 10/11? Of course, yes. MiniTool Partition Wizard can help you do that easily. Besides, this powerful partition software can be used to wipe disk, convert MBR to GPT without data loss, copy/extend/resize/shrink partitions, migrate OS to SSD, recover data, etc.
MiniTool Partition Wizard DemoClick to Download100%Clean & Safe
Step 1. Launch the MiniTool software to enter its main interface.
Step 2. Select the hard disk that you want to clean from the disk map and click Delete All Partitions from the left panel. Then click on Yes to confirm the operation
Step 3. Click on Apply to execute the pending operation.
Way 2. Clean the Disk Using a Windows Installation Disc
The Virtual Disk Service error clean not allowed on the disk error mainly occur when DiskPart cleans the disk in a normal state. If you still want to clean the hard disk using DiskPart, you need to use a Windows installation disc to start your PC and clean the disk in recovery mode.
Step 1. Insert the Windows installation disc into your computer and boot from it. If you don’t have the installation media, refer to this post to create one.
Step 2. When your computer boot from the media, click on Repair your computer on the Install Now screen.
Step 3. Select Troubleshoot and access Advanced options, then select Command Prompt from the list of options.
Step 4. In the Command Prompt window, type the following commands in order and press Enter after each one.
- diskpart
- list disk
- select disk * (replace * with the disk number that you’re ready to clean)
- clean
Way 3. Clean Install Windows 10/11
If you still can’t fix the “Virtual Disk Service error: Clean is not allowed on the disk”, you may consider performing a clean install of Windows 10/11. This operation will reset your PC to its factory settings and delete everything on the hard disk. To know more details, you can read this post “How to Clean Install Windows 11? Here Are 5 Options”.