Clean command in Windows

The clean command deletes all partitions or formats the volume from the current drive. The command applies to Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012.

Clean command syntax

clean [all]

command parameter clean

ParameterDescriptionall Specifies that each and every sector on the drive is set to 0, this will completely erase all data present on the drive.

Note:

  1. On MBR (Master Boot Record) drives, only the MBR partition information and hidden sector information are overwritten.
  2. On a GPT (GUID Partition Table) volume, the gpt partition information, including the Protective MBR, is overwritten. No hidden sector information.
  3. A drive must be selected for this to be successful. Use the select disk command to select a drive and switch to it.

Example of how to erase the drive with the clean command via Command Prompt

1. To determine the drive number assigned to a 3TB+ MBR partitioned volume, follow the steps below.

  1. From the Start menu , right-clicking on Computer will provide a drop-down menu. (If you are using Windows 8 or 8.1, move your mouse to the bottom left corner of the desktop and right-click. Then select Disk Management ).
  2. Select Manage.
  3. Select Disk Management (listed under Storage ).
  4. Find the drive identified as a 3TB (2794GB) drive. The properties window shows that the partition table on the drive is MBR.

Important : Note the drive number (such as Disk 1 ).

2. Open a Command Prompt window with admin rights.

3. From Command Prompt, type diskpart and press Enter. The diskpart command prompt will open.

Picture 1 of Clean command in Windows

4. From the diskpart command prompt, type list disk and press Enter.

Picture 2 of Clean command in Windows

5. From the diskpart command prompt, you'll need to select the drive number (for example, if the 3TB+ drive is Disk 1 , you'd type select disk 1 ) and press Enter. A message appears indicating that the drive has been selected. You'll be back at the diskpart command prompt.

Picture 3 of Clean command in Windows

6. From the diskpart command prompt, type clean and press Enter. The drive's partition, data, and signature are now deleted. You'll be back at the diskpart command prompt.

Picture 4 of Clean command in Windows

Warning : After you type clean and press Enter , the drive will be erased, no warning is provided so be careful to select the correct drive you want to erase.

7. The Command Prompt window will display the message "DiskPart succeeded in cleaning the disk" . Close the Command Prompt window by clicking the red X in the upper right corner.

Picture 5 of Clean command in Windows

8. 3TB+ drives can now be re-initialized, partitioned and formatted.

Update 25 June 2021
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile