How to completely format hard disk using CMD

Sometimes some computer problems occur that force you to format hard disk as clean and new. Today we explain how to format your hard drive or SSD to leave them as they left the factory, ready to install Windows without problems or annoying format incompatibilities.

There are many things that can potentially go wrong in computing. In the process of reinstalling the operating system, you may experience a power outage, resulting in a completely unusable file system. It is not the only situation where you will need to know how to format your hard disk.

Another case is that you need to install Windows, but you have problems during the installation, usually due to the file format of your hard disk. In Windows it has to be NTFS, but if you come from Linux, for example, you will find yourself with the unpleasant surprise of not being able to continue with the installation.

For all that and more, today we explain in this tutorial how to completely format your hard drive. It is the panic button that you should only press when you have exhausted other possible solutions. Of course, remember that you should always have a Windows, Linux or any other operating system installation CD or USB on hand, as this method leaves your HDD or SSD completely empty.

Reasons to format your hard disk

Although we have already told you some, there are several reasons why we may want to format hard drive on which we have the operating system. 

Obviously they have to be moderately serious situations, since, if not, it is not normal to run out of Windows and have to reinstall it again.

Install windows 10
Install windows 10
  • Installation failure : as we told you before, it may be that we were installing the system or an important update and the power went out, leaving the computer very touched. It has also been possible to give the problem if the disk format was wrong.
  • Problems to turn on : it may be that the computer itself is not capable of always turning on and we need to format the disk to know if it is a consequence of the operating system.
  • Excessively slow : another option to format it is if the system is extremely slow, since it may be due to some type of virus, something that will be eliminated with a format. In this case we can include the system startup, since if we see that it takes a long time to start and we have tried all the options, formatting can also be a solution.
  • Blue screen : if the dreaded blue screen is shown very often and does not allow us to work, it can be another good reason to format, since normally this type of failure is associated with some type of software problem.

Actions before formatting

If the error you have allows it, it would be convenient to carry out several actions before proceeding to format and run out of the operating system.

Some of the errors that we have seen before may not allow us to carry out the actions that we are going to suggest below, but if you can, they would all be very convenient

  • Windows Installer : if you have a Windows CD then perfect, but if not, you should create a system installer USB to reinstall Windows again. 
  • Backup : since we are going to erase everything, it would be useful to be able to make a backup copy of everything that we want to restore in the new Windows that we are going to install. Personal files, settings, or things like that.
  • Drivers : it would be convenient to have the drivers for all our components, although Windows identifies and updates them. Some may use specific programs and have to be reinstalled, but if we already have them, we are free to download them again.

Format thanks to the command console

As we told you before, you must have a Windows installation CD or USB. Then at that moment access to install it, but when you select your hard drive, error! For some reason that you probably do not know, the option to install the system on your HDD or SSD does not appear or does not let you click on it.

You don’t know what to do, so you consider starting completely from scratch. We are going to help you: 

  • The first thing you have to do is start with the installation normally, with the difference that instead of selecting Install you must click on Repair computer.
  • Then choose Troubleshoot.
  • Right after you go to Advanced Options
  • Then access the command console.
  • Now a bit of expert mode computing, or something similar. Here you must enter several commands to confirm that you want to format your SSD or HDD hard drive. Specifically, the NTFS format essential to install any version of Windows. 
  • As we are already inside the command console or also known as Command Prompt, it is time to type the following and press Enter: X: \ Sources> diskpart
  • Then we will write DISKPART> list disk to press Enter at the end.
Format hard disk using cmd
Format hard disk using cmd

You have just listed all the hard drives or storage devices that your system detects. You will see a list with them and their size, so you just have to decide which one you want to format.

The next action is to select it and enter the following commands one after the other. The goal is to erase the contents of the disk and create a new empty partition in the NTFS format. Remember to hit Enter every time you type each of them:

  • DISKPART> select disk [enter the number of the chosen one]
  • DISKPART> clean
  • DISKPART> create partition primary
  • DISKPART> select partition 1
  • DISKPART> active
  • DISKPART> format fs = NTFS

If everything went well, it will start to format the hard drive. It can take a long time, so you don’t need to keep an eye on the process. 

To finish you just have to write the following, pressing Enter after each of these commands:

  • DISKPART> assign
  • DISKPART> exit

From here, you can install Windows 10 from scratch, accessing from the CD or USB where you have the operating system. The simplest thing is to go to the BIOS and select that the first thing to read the unit is, that way you will access the installation menu of the Microsoft operating system.

Now you will not have any problem installing it and if you are unlucky enough that something happens during this process, you already have the solution.

Leave a Reply