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

  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.

  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

  5. Type the following command:
    clean

    This will erase all data from your 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

  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

  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

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

    This will securely wipe all data from your drive.

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.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

11 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. 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
  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
  3. Casey McNeily

    I always use this tool because it’s simple and written in Java so can be used on my personal Mac as well as the Windows workstation at office.

    https://www.softpedia.com/get/Security/Secure-cleaning/Shred.shtml

    Reply
  4. Joe Bloe

    “Deprecated” and “No longer in use” are two different things. You’re talking around yourselves. There will come a day, probably very soon now, where diskpart will no longer ship with Windows at all. Meanwhile, you can use it.

    Reply
    1. Mac

      The original poster said it was deprecated 5 years ago. And yet here we are still using it. I think we’ll be fine.

      Reply

Leave a Reply

Your email address will not be published.