Securely Wipe a Disk with Diskpart in Windows 10

DiskPart is a text-mode command interpreter bundled with Windows 10. This tool enables you to manage objects (disks, partitions, or volumes) by using scripts or direct input at the command prompt. A lesser known feature of DiskPart is the ability to wipe a disk or a partition securely.


As you may already know, Diskpart comes with a "clean" command. We described this command in the article How to install Windows 10 from a bootable USB stick. In short, the sequence is as follows.

  1. Open an elevated command prompt
  2. Type the following:
    diskpart

    Windows 10 Open Diskpart

  3. Now, type the following in diskpart's prompt:
    list disk

    It will show a table with all your disks. Note the number of the disk you need to erase.
    In my case, it is Disk 1.Windows 10 Diskpart List Disk

  4. Now, you need to select your disk in diskpart. Type the following:
    sele disk #

    Where # is the number of your drive. In my case, it is 1, so I have to use the following command:

    sele disk 1

    Windows 10 Diskpart Select Disk

  5. Type the following command:
    clean

    This will erase all data from your disk.Windows 10 Diskpart Clean Disk

This way, you can erase any disk or partition available on your PC. This information can be recovered though, using special data recovery software. The regular clean command doesn't wipe the disk securely. However, DiskPart also allows you to erase the drive's contents securely, so the information can't be restored any more. You might want to run this to destroy sensitive data from a drive. Here is how.

To securely wipe a disk with diskpart in Windows 10, do the following.

  1. Open an elevated command prompt
  2. Type the following:
    diskpart

    Windows 10 Open Diskpart

  3. Type the following in diskpart's prompt:
    list disk

    It will show a table with all your disks. Note the number of the required drive.
    In my case, it is Disk 1
    Windows 10 Diskpart List Disk

  4. Now, you need to select your disk in diskpart. Type the following:
    sele disk #

    Where # is the number of your drive. In my case, it is 1, so I have to use the following command:

    sele disk 1

    Windows 10 Diskpart Select Disk

  5. Instead of "clean", execute the following command:
    clean all

    This will securely wipe all data from your drive.Windows 10 Diskpart Clean All

The "clean all" command fills every sector on the disk with zeroes, so information can't be recovered. It completely deletes all data stored on the disk, all its partitions, folders, files etc - everything. The operation usually takes a lot of time, so be careful and patient.

That's it.

5 thoughts on “Securely Wipe a Disk with Diskpart in Windows 10

  1. anon

    DiskPart is deprecated. Consider providing an article on a PowerShell equivalent instead.

    https://msdn.microsoft.com/windows/compatibility/vds-is-transitioning-to-windows-storage-management-api

    Reply
    1. Abhishek Kumar

      Diskpart is not deprecated.

      Reply
      1. anon

        But it is and it says that right there on the page. DiskPart and other tools that rely on the old VDS will continue to be available until the latter is removed from Windows.

        Reply
        1. Abhishek Kumar

          It won’t happen tomorrow. I don’t think that Sergey should change the article.

          Reply
  2. DexterG

    You can run DiskPart and the Clean commands shown in this article from the Windows 10 install media (ideally a USB thumbdrive) by selecting Repair at the first screen rather than starting the Windows 10 installation. I use this all the time for reinitializing a drive before installing Windows. It is especially useful for triggering the Bitlocker self-encryption feature of Crucial SSDs (which support the Microsoft eDrive hardware encryption standard.)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.