How to Diskpart Erase or Clean a Drive

How to Diskpart Erase or Clean a Drive

How to Diskpart Erase or Clean a Drive Through the Command Prompt

How to Diskpart Erase or Clean a Drive

source

Critical Instructions:

  • Disclaimer: Seagate Technology, LLC is not responsible for lost user data. Be sure to back up any important data on this drive before proceeding.
  • This article explains the Microsoft Diskpart Erase utility. The command that erases the drive during this process is “Clean”. In this article “Clean” and erase are used interchangeably. Cleaning or erasing a storage device removes all data and partitions from the drive.
  • Please read all steps, instructions, and warnings before attempting the Diskpart Erase/Clean. 
  • Diskpart Erase/Clean will permanently erase/destroy all data on the selected drive. Please make certain that you are erasing the correct disk.
  • Remove all additional drives from the computer excluding the drive you are booting from and the drive you want to Erase/Clean.
  • For more information regarding Microsoft’s Diskpart Utility please select here: http://technet.microsoft.com/en-us/library/bb490893.aspx

Items to note:

  • This article will walk through the steps of using the Microsoft Diskpart Erase utility to Clean the disk of a previous partition and format, including any data on the drive. This command takes only a few minutes to complete.
  • This article covers Diskpart Erasing a 3TB or larger drive that has a Master Boot Record (MBR) Partition table, which is thereby limiting its capacity to 2TB. However, this article also applies to any scenario where a Diskpart Erase of an entire disk is necessary.
  • For more information regarding drives over 2TB and GPT/MBR partition tables please see the following articles.

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

    1. From the Start menu right click on Computer which will provide a drop down menu. (If you are on Windows 8 or 8.1 move your mouse to the bottom left hand corner of the desktop screen and right click. Then select Disk Management).
    2. Choose Manage.
    3. Select Disk Management (listed under Storage).
    4. Look for the drive that is identified as the 3TB drive (2794GB). The properties window shows that the partition table on the drive is MBR . Important: note the Disk number (such as Disk 1).
      Shows disk management with a properties box open. Disk 1 is squared off and there is an arrow pointing to "2048GB Unallocated" and Master Boot Record

  2. Open a Command Prompt window. To open the Command Prompt on a Windows Vista or Windows 7 machine click on Start and type cmd in the search bar. Then right click on cmd.exe and run as administrator. It will prompt you with the message, “Do you want to allow the following program to make changes to this computer,” click yes. A black Command Prompt window will open.
    Shows how to search for CMD from the Start Menu. There is an arrow pointing to the text cmd and the application cmd.exeOn Windows 8 move your mouse to the bottom left hand corner of the desktop screen and right click. Select Command Prompt (Admin) from the pop-up menu.
    Shows the pop up window from Windows 8. The Compand Prompt (Admin) is highlighted. There is an arrow pointing to Command Prompt (Admin)This is the Command Prompt window.
    Shows the command prompt window C:Windowssystem32>_ is the bottom line.
  3. From the command prompt, type diskpart and press Enter.
    Shows the command prompt window shows that I have typed "diskpart"The diskpart prompt will open.
    Shows the command prompt window that DISKPART> is now the selected command
  4. From the diskpart prompt, type list disk and press Enter.
    Shows the command prompt window and that I have typed "list disk"A list of disks will appear in a text format. You will return to the diskpart prompt. Step one verified that Disk 1 is the 3TB drive.Warning: Diskpart Erase/Clean will permanently erase/destroy all data on the selected drive. Please be certain that you are erasing the correct disk. "Shows the command prompt window and displays all detected disks. Disk 1 is squared off. "
  5. From the diskpart prompt you will need to select a disk disk number (for instance, if the 3TB+ drive is Disk 1, you would typeselect disk 1) and press Enter. Warning: Diskpart Erase/Clean will permanently erase/destroy all data on the selected drive. Please be certain that you are erasing the correct disk.
    Shows the command prompt window and that I have typed "select disk 1"A message appears saying that the disk is selected. You will return to the diskpart prompt. Warning: Diskpart Erase/Clean will permanently erase/destroy all data on the selected drive. Please be certain that you are erasing the correct disk.
    "Shows the command prompt window and displays that Disk 1 is now the selected disk "
  6. From the diskpart prompt, type clean and press Enter. The drive’s partition, data, and signature is now removed. You will return to the diskpart prompt. Warning: Once you type clean and hit enter the drive will be erased. No warning will be provided.
    Shows the command prompt window and that I have typed "clean"
  7. The Command Prompt window will display the message “DiskPart succeeded in cleaning the disk“.  Close out of the Command Prompt window by clicking the red X in the upper right hand corner.
    Shows the command prompt window and displays DiskPart succeeded in cleaning the disk. DiskPart succeeded in cleaning the disk is squared off.Now the 3TB+ drive can be re-initialized, partitioned, and formatted.
  8. Reference How to use Add a New Disk/Reformat in Windows using DiscWizard v16 to Initialize the drive in GPT and format the drive for use.

How to Diskpart Erase or Clean a Drive

Format a hard drive with Command Prompt

Format a hard drive with Command Prompt

Format a hard drive with Command Prompt

source

In Windows I would normally be driven to either format a drive through the Disk Management console or by right-clicking on a drive in Windows Explorer and selecting the “Format…” option, but there can be advantages to formatting a driver through Command Prompt. For example if you are reformatting a drive which previously had an Operating System on the drive you can find there are System Partitions on the drive which can’t be seen in Windows Explorer and refuse to format in the Disk Management console.

Note this is only a quick guide for Formatting Drives from Command Line, there are many more options available at your disposal. For a detailed insight to the options available for the DiskPart tool visit Microsofts Technet. In the example I have formatted an external hard drive for use of file storage in a Windows Operating System environment.

In order to format a drive through Command Prompt firstly lets open the prompt.

Click Start > Run and type “CMD”, pressing Enter should open a new terminal.

Start CMD

 

We need to next start the Disk Part tool, type “DISK PART” into the Command Line and press Enter.

Start Disk Part

 

Next let’s display and identify which volume we would like to format. Type “list volume” and press Enter. You should see a list of available volumes. Identify the one which you wish to format, be careful selecting the wrong volume will spell disaster!

List Volume

 

Type “select volume <x>” and press Enter, where <x> is the volume you wish to focus on.

Select Volume

 

Type “clean” and press Enter. This removes any and all partition or volume formatting from the disk in focus.

Clean

 

Type “create partition primary” and press Enter. This creates a primary partition on the current disk. After you create the partition, the focus automatically shifts to the new partition. It is possible to create multiple partitions if you like. To do this you would add the option size=<x> where <x> is the size in megabytes (MB) you would like the partition to be. If no size is specified, like in my example, the partition continues until there is no more unallocated space.

Create Partition

 

Type “format fs=ntfs quick label=test” and press Enter. This will now perform a quick format, using a ntfs file system and labelling the drive “test”. You may wish to use the file system fat32 in place of ntfs if you would like to use the drive with other operating systems.

Format

 

Lastly type “assign letter <x>” and press Enter, where <x> is the letter you would like to assign the drive.

Assign Drive Letter

You can close the Disk Part tool and Command Prompt using the “exit” command. You should now see your freshly formatted drive in My Computer, ready to use.

 

 

Format a hard drive with Command Prompt