Advertisement

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.

Advertisеment


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.

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!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

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

  1. 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

      1. 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.

  2. 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.)

  3. 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

      1. “Deprecation” is a development label/marker added to packages or applications to highlight, that they are put under legacy support (no further development) and you should switch to some newer implementation, because the old one is going to be removed sooner or later.

  4. “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.

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

      1. Windows 10 is the way of the future. Yesterday, Microsoft announced they are not capable of counting any higher and as a result, windows 9 will be the next release. This followed by a Special edition of our favorite and never out of style…. Windows 10 (rebranded Windows 10.5) w/ built in Disk Part! :-)

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.