Windows 10: Erase Disk using Diskpart Clean Command in Windows 10  

Page 1 of 3 123 LastLast
    Erase Disk using Diskpart Clean Command in Windows 10

    Erase Disk using Diskpart Clean Command in Windows 10

    How to Erase a Disk using Diskpart Clean Command in Windows 10
    Published by Category: Hardware & Drivers
    29 Oct 2017
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 32,340

    Show Printable Version 


    How to Erase a Disk using Diskpart Clean Command in Windows 10

    information   Information
    You can use the clean or clean all Diskpart command options to erase (wipe) a disk leaving it unallocated and not initialized.

    The clean command removes any and all partition or volume formatting from the disk with focus. On master boot record (MBR) disks, only the MBR partitioning information and hidden sector information are overwritten. On GUID partition table (GPT) disks, the GPT partitioning information, including the Protective MBR, is overwritten; there is no hidden sector information. The clean command will only mark the data on the disk as deleted, and will not zero (secure erase) the disk like the clean all command below.

    The clean all command performs the same action as the clean command above, but includes to specify that each and every sector on the disk is zeroed (secure erase), which completely deletes all data contained on the disk. This will make the data on the disk unrecoverable. It will take about an hour per 320 GB to finish running the "clean all" command on a disk.

    This tutorial will show you how to use the clean or clean all Diskpart commands to erase a disk in Windows 7, Windows 8, and Windows 10.

    You must be signed in as an administrator to "clean" or "clean all" a disk.

    warning   Warning
    Be sure you verify the correct disk number of the disk you want to erase from Disk Management (diskmgmt.msc) before doing the steps below.

    You do not want to erase the wrong disk, and lose data.


    EXAMPLE: Disk that is not initialized and unallocated after running "clean" or "clean all" command
    Name:  Disk_Management_unallocated_disk.jpg
Views: 14801
Size:  121.5 KB



    Here's How:

    1. Open either an elevated command prompt or a command prompt at boot for what you want to use.
    Note   Note
    You will not be able to run the clean or clean all command on the disk that Windows is installed on unless you do so in a command prompt at boot.


    2. Type the command below, and press Enter. (see screenshots below step 5)

    diskpart

    3. Type the command below, and press Enter.

    list disk

    4. Type the command below, and press Enter.

    select disk #

    Note   Note
    Substitute # in the command above with the actual disk number (ex: "3") of the disk you want to clean.

    For example: select disk 3


    5. Type the command below you want to use, and press Enter.
    Note   Note
    The clean command will finish quickly since it only marks the data on the disk as deleted.

    The clean all command will take about an hour per 320 GB to finish running since it performs a secure erase.


    clean

    OR

    clean all

    Name:  diskpart_clean_command.png
Views: 14883
Size:  28.3 KB Name:  diskpart_clean-all_command.png
Views: 15241
Size:  37.8 KB


    6. You can now initialize the disk, convert the disk to MBR or GPT, and create a New Simple Volume on the disk. (see screenshots below)

    Name:  Disk_Management-Initialize_Disk.jpg
Views: 14617
Size:  96.3 KB Name:  Disk_Management-New_Simple_Volume.jpg
Views: 14741
Size:  107.9 KB


    That's it,
    Shawn


  1.    31 May 2017 #1

    Wow - I learnt something new here - the clean all command.

    So boot from an installation drive, press shift+f10, select OS drive in diskpart and use clean all if selling PC - so who needs DBAN!
      My ComputerSystem Spec

  2. Brink's Avatar
    Posts : 32,340
    64-bit Windows 10 Pro build 18242
    Thread Starter
       31 May 2017 #2

    Correct. That will wipe the OS drive completely.
      My ComputersSystem Spec

  3.    01 Jun 2017 #3

    Brink said: View Post
    Correct. That will wipe the OS drive completely.
    Might just be worth adding a sentence how to get to diskpart from an installation drive or similar.

    Actually a mini iso that just booted to the command prompt would be a really handy tool but never seen one.
      My ComputerSystem Spec

  4. Brink's Avatar
    Posts : 32,340
    64-bit Windows 10 Pro build 18242
    Thread Starter
       01 Jun 2017 #4

    I have a link in step 1 for how to open a command prompt at boot to help.
      My ComputersSystem Spec

  5.    13 Jul 2017 #5

    Hello,

    I wan to re-install Win10 on a SSD, but want to do a clean-all command from diskpart first (virus issues). However, upon trying to do a secure erase first in Command Prompt (admin) - diskpart - selected disk - clean all, I got an error: "Clean all is not allowed on the disk containing the current boot, system, pagefile, crashdump, or hibernation volume."

    There's only Disk 0 as an option, I assume the error is because I can't do a clean wipe of the disk/OS I'm currently using?

    I have Win10 USB ready. Can I do a diskpart at start-up from the installation USB? Or is there another method to completely wipe the SSD before re-installing? Thank you :)
      My ComputerSystem Spec

  6. Brink's Avatar
    Posts : 32,340
    64-bit Windows 10 Pro build 18242
    Thread Starter
       13 Jul 2017 #6

    Hello scop8, :)

    You should be able to run the "clean all" command from a command prompt at boot when opened after booting from Windows 10 installation media.
      My ComputersSystem Spec

  7.    13 Jul 2017 #7

    I'll give it a shot, thanks Brink :)
      My ComputerSystem Spec

  8. Brink's Avatar
    Posts : 32,340
    64-bit Windows 10 Pro build 18242
    Thread Starter
       13 Jul 2017 #8

    Please let us know how it went. :)
      My ComputersSystem Spec

  9. mrje1's Avatar
    Posts : 312
    Windows 10 Pro x64 Build 1803
       4 Weeks Ago #9

    Hey Brink again!

    Is this normal for it to repeat itself like shown in this image? Because I don't seem to see any mention of that?

    Name:  diskpart.jpg
Views: 2215
Size:  34.4 KB
      My ComputerSystem Spec


 
Page 1 of 3 123 LastLast

Tutorial Categories

Erase Disk using Diskpart Clean Command in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Xbox Windows Phone


Related Threads
Hi Starting the command prompt from the Windows 10 v1703 DVD, how do I display the disk free space to create other partitions using Diskpart utility? Thanks Bye
W10 Diskpart/disk list in Drivers and Hardware
Hi to all and thank you to Spunk and Navy LCDR - Issue almost resolved from your help. I have just installed, in my notebook an old SSD EVO 850 Samsung as a 'second' separate SSD to use for a back-up. When I try to use Diskpart to clean this...
Upgraded my Win 7 Ultimate x64 to Win 10. Now when I went to perform a clean install of the Win 10 with USB created from Microsoft Media, take me through to the screen to partitions. There are three partitions, one marked as OEM. What could be...
Upgraded my Win 7 Ultimate x64 to Win 10. Now when I went to perform a clean install of the Win 10 with USB created from Microsoft Media, take me through to the screen to partitions. There are three partitions, one marked as OEM. What could be...

Tags for this Thread

Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 02:49.
Find Us