Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Hardware»Storage»How to Format Hard Drive from Command Prompt

How to Format Hard Drive from Command Prompt

Anup ThapaBy Anup ThapaSeptember 28, 2022
format hard drive from command prompt

Generally, GUI components like File Explorer or Disk Management are easy-to-use and sufficient to format a hard drive in Windows. However, for certain scenarios, such as when you need to convert a drive’s partitioning scheme, mark a partition as active, or simply format the boot drive, command line tools become necessary.

Even in a general context, the formatting process can be confusing if you’re unfamiliar with things like partitions, partitioning flavor, and filesystems. As such, we’ve included all such necessary details and listed the full steps to format a hard drive using CMD.

Formatting Options

Let’s talk about the options you’ll need to specify when formatting a hard drive, starting with MBR and GPT. A hard drive is partitioned into blocks or sectors, and the layout of such partitions on the HDD depends on the partitioning scheme used.

We have an in-depth article on the differences between MBR and GPT, but the key takeaway for practical reasons is that GPT is recommended in most cases as it addresses and improves on many of MBR’s limitations. In certain cases, such as when you need to install Windows 11 on the drive, GPT is actually a necessity as it’s a core requirement for Windows 11.

ssd partitions blocks

Similarly, a file system is how the OS manages and names groups of data. In the case of Windows, FAT32, NTFS, and exFAT are the relevant file systems. FAT32 drives have excellent compatibility and will work on other systems like Mac and Linux as well. But it’s limited by the fact that it can only support a max of 4 GB files and 32 GB partitions.

NTFS is the default file system in Windows. As it’s designed for Windows, it offers the best performance and the most features. But by the same token, NTFS drives have terrible compatibility with other platforms. exFAT, to put it simply, is the best of both worlds, with a mix of compatibility and performance.

Important: When formatting drives from the command line, it’s very easy to mess up the commands and format the wrong drive. So, make sure to double-check the commands before executing them to ensure you format the correct drive.

How to Format Hard Drive From CMD?

If the hard drive has a single partition, you can simply use the format command (e.g., format E:) to format the drive entirely. You can use additional parameters to modify its functionality, as shown below:

  • The format command by itself performs a thorough sector-by-sector scan during the format, while using the /Q option performs a quick format (e.g., format E: /q).
    quick-format-cmd
  • To format the disk with a specific filesystem, you can use the /FS option (e.g., format E: /fs:ntfs), replacing NTFS with exFAT or FAT32 as you prefer.
    format-to-ntfs-cmd
  • The /P option lets you zero-fill every sector on the disk. After that’s done, you can also set the count for how many times random numbers are used to overwrite the sectors (e.g., format E: /P:2). This is important if you’re trying to completely wipe the drive so that the data can’t be recovered later.
    zero-fill-overwrite-sectors-cmd
  • These are the important parameters, but there are various others that can be useful sometimes (like /V to specify the volume label). For the full list of such options, we recommend referring to Microsoft’s documentation.

When you need to perform tasks like formatting specific partitions only or cleaning all filesystems and partitions, you can use diskpart with the steps listed below:

  1. Press Win + R, type diskpart, and press Enter.
  2. Enter list disk and note the disk # you’re trying to format.
    diskpart-list-disk-sel-disk
  3. Use select disk # to select the disk.

After selecting the disk, you can do a couple of things. First, to format certain partitions only, you can follow the steps listed below:

  1. Enter list vol, identify the volume you want to format and note its volume # or letter.
    diskpart-list-vol-sel-vol
  2. Select the volume with sel vol #.
  3. Type format fs=ntfs quick and press Enter.
    format-fs=ntfs-quick

Second, to completely format the drive and remove all the partitioning information, you can select the disk as shown above and use the clean command as such:

  1. Assuming the disk is selected, enter clean to clear all formatting information first.
  2. (Optional) At this stage, you can convert the disk to MBR (convert MBR) or GPT (convert GPT) if you want.
    clean-create-partition-primary
  3. As there are currently no partitions on the drive, you can use the create partition primary command to create a primary partition.
  4. Now, you can format the partition with your preferred file system (e.g., format fs=fat32 quick).
    sel-partition-format-fs=fat32-quick
  5. Then, you can assign it a drive letter if it doesn’t already have one (e.g., E, with assign letter=E). With this, the drive should be formatted and accessible.

How to Format Boot Drive?

If you attempt to format the boot drive from a live Windows environment, you’ll encounter the Volume is in use by another process error. Instead, you must boot to the Windows Recovery Environment (WinRE) first.

Here’s how you can do this:

  1. Hold Shift and restart your PC to boot into WinRE. Alternatively, you can force-restart the PC 3 times in a row to do the same.
  2. If these methods don’t work, you can also insert an installation media and boot to it. Then, you can use the Repair your computer option to boot into the recovery environment.
    repair your computer windows install
  3. In WinRE, select Troubleshoot > Advanced Options > Command Prompt.
  4. In CMD, execute the following commands:
    Diskpart
    List vol
    list-vol-winre
  5. Note the drive letter of the boot volume. Double-check at this stage, as the volume letters may be different from that in the live Windows environment.
  6. Now, select the boot drive and the format it as shown in the example below:
    Sel vol #
    Format fs=ntfs quick
    winre-format-volume
  7. Enter exit twice to exit diskpart and command prompt. 
how-to
Anup Thapa
  • LinkedIn

Anup Thapa is a tech writer at TechNewsToday. He mostly writes informative articles, tutorials, and troubleshooting guides related to Windows systems, networking, and computer hardware. Anup has been writing professionally for almost 5 years, and tinkering with PCs for much longer. His love for all things tech started when he got his first PC over 15 years ago. It was a Pentium IV system running Windows XP on a single 256 MB stick. He spent his formative years glued to this PC, troubleshooting any hardware or software problems he encountered by himself. Professionally, Anup has had brief forays into a variety of fields like coding, hardware installation, writing, etc. In doing so, he's worked with people of different backgrounds and skill levels, from average joes to industry leaders and experts. This has given him not just a versatile skillset, but also a unique perspective for writing that enables him to concisely communicate complex information and solve his reader's problems efficiently. You can contact him at anup@technewstoday.com

Related Posts

sata ports on motherboard

All the Types of SATA Ports on Motherboard

March 21, 2023
m2 ssd not showing up

M.2 SSD Not Showing Up? Here’s How to Fix It

March 15, 2023
c drive vs d drive

C Drive Vs D Drive – What’s the Difference?

March 12, 2023
recover data from dead hard drive

How to Recover Data from Dead Hard Drive (Dead Computer)

February 19, 2023
How to Replace Laptop Hard Drive

How to Replace Laptop Hard Drive (Step-by-Step Guide)

February 17, 2023
how to insert a sd card 1

How to Insert a SD Card on PC (Step-by-step Guide)

February 8, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
what-does-collate-mean-on-a-printer

What Does Collate Mean on a Printer?

March 31, 2023
usb-vs-pcie-wifi

USB Vs PCIe Wi-Fi—Which One is Better?

March 31, 2023
how often to replace laptop

How Often Should You Replace a Laptop

March 29, 2023
You may also like
computer suddenly slow

Why is My Computer Suddenly Slow? 11 Ways to Fix It

March 31, 2023
HTTP-Error-431

How to Fix HTTP Error 431

March 31, 2023
scheduled task reboot

How to Create a Reboot Scheduled Task in Windows

March 31, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday, editor@technewstoday.com | Tech Central Pvt. Ltd.

Type above and press Enter to search. Press Esc to cancel.