Format Your Hard Drive Using DiskPart and Command Prompt

Do you know how to format hard drive using DiskPart? Learn it here! While executing commands if you lose your vital data, regain it with Recoverit Data Recovery software.

Sep 03,2019 • Filed to: Answer Hard Drive Problems • Proven solutions

0
Yesterday I was trying to format the hard drive of my computer using DiskPart. But I am not sure about the detailed steps. Can anyone guide me how to format using DiskPart?

Hard drive formatting is always crucial, and if not done appropriately, it can even make it non-functional. But performing it with DiskPart or command prompt can save your hard drive from this risk. A formatted drive is almost the same as like the new drive because formatting clears all the stored media. This article will guide you through the DiskPart commands and ways of formatting hard drive with DiskPart and Command Prompt.

Part 1- How to Clean Hard Drive Using DiskPart

Before learning the steps for cleaning the drive, let’s first understand what does DiskPart clean do? When you use the “clean” command in Diskpart, the utility software will clean the selected disks and information from the hidden sectors. All the stored data gets deleted, and you can’t undo it. It is recommended to take a backup first if there is some important data in the drive.

The time taken by the complete process depends on the disk size. To clean the drives follow the following steps:

Step 1- Open Command Prompt

Search command prompt, right-click, and run it as an administrator.

option showing cmd to run as administrator

Step 2- Type diskpart

Type the command as mentioned above and press ‘‘Enter’’ to launch DiskPart.

cmd showing diskpart command

Step 3- Type list disk

The command will list all the drives that are available with the computer. After typing the command, press ‘‘Enter’.’

list disk command highlighted

Step 4- Select the Drive by typing select disk *

The * mentioned in the command needs to replaced with the drive number that requires cleaning. Make sure you put the right number else you will end up cleaning the wrong drive.

disk highlighted that would undergo the cleaning process

Step 5- Type clean

The “clean” command will wipe out your required hard drive. Press ‘‘Enter’’ after typing it. It will clean up all the files and folders of the drive permanently.

window showing clean command

Step 6- Close the Command Prompt after Successful Completion of Disk Cleaning Once the cleaning process completes, the command prompt will show the message that DiskPart cleaning is successful. Close the window from the button located up in the right corner.

window showing disk cleaning successful

Now you can reinitialize, partition and even format the cleaned drive.


Part 2- How to Format Hard Drive Using Command Prompts

While formatting a hard drive, you can clean both storage media- internal as well as external. But before beginning the formatting, you need to complete the cleaning of the drive first. The steps are the same as explained above. Once the disk cleaning is successful; you can continue with the formatting of the drive.

To understand how to format using DiskPart look for detailed steps below:

Step 1- Open the command prompt and run as administrator.

Step 2- Type diskpart and press ‘‘Enter’.’ It will launch the DiskPart.

Step 3- Type list disk to let the Diskpart list all the drives of the computer.

Step 4- Select the required drive by typing select disk *, here * is the number of the drive that will undergo formatting.

Step 5- Clean the files and folders on the selected drive using the clean command.

window showing highlighted commands that are required for cleaning the drive

Step 6- Type list disk and press ‘‘Enter’’ to confirm the drive that needs to be formatted is still selected.

Here the output that comes out has an asterisk (*) before the selected drive.

Step 7- Create a new partition by typing create partition primary and press ‘‘Enter’.’

partition memory created

Step 8- Select the created partition and press ‘Enter’ after typing the command select partition 1.

Step 9- Type active so that selected partition comes in an active state. Press ‘Enter’ after that.

selected partition is active

Step 10- Format the drive with the command format fs=ntfs. Press ‘Enter’ to begin the process.

window showing format command

Step 11- Assign a letter to the drive, to make it available in the File Explorer and then exit.

Press ‘Enter’ after typing assign letter=*, type your preferred letter in place of * that you want to assign to the partition.

Then to exit the DiskPart, type exit and ‘Enter.’

windows showing highlighted commands

After completing all these steps, the drive is available at File Explorer. You can now start storing files on the drive.


Part 3- How to Delete Hard Drive Partition Using DiskPart

Sometimes for better management, you need to create more free space by deleting partitions. You also want to delete them because you don’t require them anymore or it has become damaged or corrupted. Follow the listed steps to delete the partition with DiskPart.

Step 1- Launch DiskPart in command prompt by typing diskpart. Press ‘Enter.’

Step 2- Type list disk and then press ‘Enter’ to list down all the available partitions.

Step 3- Select the disk to delete your required partition. Type select disk *, (*) is the disk number. After typing the command press ‘Enter.’

Step 4- Type list partition and then ‘Enter’ to view all the partitions.

Step 5- Now select the partition to be deleted by typing select partition *, again * here is the number of the partition. ‘Enter’ after typing the command to execute it.

Step 6- Now delete the partition by typing delete partition and begin the deletion by pressing ‘Enter.’

image showing all the commands required for partition deletion

If the dynamic disk is in use, use the delete volume command for deletion process.


Part 4- What are the DiskPart commands?

DiskPart is a command-line tool that does disk management with a simple Command Prompt. You can do disk listing, partitioning, and even deletion of partitions with this tool. There are several DiskPart commands that are used to execute these functions.

The tool first came in Windows XP, and now it is available on almost all operating systems of Microsoft- Windows 2000, XP, Vista, 7, 8, and 10. Before initiating with Diskpart commands on Command Prompt, it is necessary to make a list and then focus by selecting an object. In this way, DiskPart commands will act on the focused object.

As Diskpart gets loaded on the Command Prompt, let’s understand a little about it. Command Prompt, also known as cmd, is referred to as command-line interpreter. It is available in all operating systems. The program allows you to ‘Enter’ and execute commands. As the mouse operates the buttons and menu of the graphical user interface; in the same manner, cmd uses command ‘Enter’ed from the keyboard in the form of text. The ‘Enter’ed commands are then converted into operating system understandable functions. Windows Command Processor is the official name of the Command Prompt. It is also known as command shell, cmd prompt and is also popular as cmd.exe that is with its file name. At times it is even referred incorrectly as DOS prompt or even MS-DOS. Though the Windows program – Command Prompt has many MS-DOS abilities but calling it, MS-DOS would be incorrect.

You will be using the platforms like DiskPart and Command Prompt for disk formatting. It is the process of configuring storage mediums like a flash drive and hard disk drive. During the formatting process, any of the documents or files that are already saved on the drive gets deleted. Usually, it is done before the installation of the operating system, and many times, it is also required for creating an additional storage space too.

Note: Your stored data gets erased when you format drive using cmd. Though it can be retrieved by using the recovery software, taking a backup is still advised. It allows you to save a copy of your data at a secure place for uncertain situations like drive corruption, formatting, accidental deletion, etc.


Part 5- DiskPart Format Command Options

DiskPart format command that runs on command prompt is used for formatting internal and external storage mediums of hard drives. The command is available in all Windows operating systems like Windows 10, 8 7, Vista, XP and in other older versions too. You can use it to deal with unlocked files means the files that are not currently in use. However, the syntax for the command differs from one operating system to another.

The format command syntax is as following:

format drive: /* /fs:file-system /r:revision /d /v:label /p:count /?

Here * refers to q, c, x, and l

Now understand the syntax in detail:

It is used to show help for the several options of commands.


Closing Words

If your hard drive is causing any trouble, you can now quickly fix it by using DiskPart. Follow the steps explained above to clean and format disk using DiskPart, and also to delete hard drive partition. Before performing any of these actions, it is necessary to take backup of the data. Somehow if you forgot taking backup and lost any of your important files during DiskPart commands execution, don’t panic. Use Recoverit Mac Data Recovery software to retrieve your lost data.

0 Comment(s)
Home | Resources | Answer Hard Drive Problems | Format Your Hard Drive Using DiskPart and Command Prompt