Форматирование диска через консоль windows

Last Updated :
12 Apr, 2025

Formatting a hard drive is a common step when setting up a new disk or repurposing an old one. Although there are various methods to format in Windows, using the Command Prompt offers a fast and efficient option, particularly for advanced users.

This article will show you how to format a hard drive using Command Prompt, giving you step-by-step instructions to ensure the process is done safely and effectively. Whether you’re dealing with an internal HDD, an external drive, or a USB stick, formatting a hard drive in CMD is a useful skill to have.

How to Format a Hard Drive Using Command Prompt?

Find the steps below to learn how to format a hard drive using a command prompt. In the section below, we have discussed all the steps in detail.

Step 1: Open Command Prompt

Open the Command Prompt as an Administrator. Execute the ‘diskpart‘ command in CMD. It will go inside the Disk Partition.

Command: diskpart

1--Diskpart

Step 2: Use Disk List Command

Now, let us see all the Windows Disk present on the device. Note down the Disk Number that should be formatted.

Command: list disk

2--List-Disk

Step 3: Select the Disk Number

Using the following command, select the disk that will be formatted.

Command: select disk <disk number>

3--Select-The-Disk

Step 4: Use Clean Commnad

Now, use the simple command to Quick Clean the Drive.

Command: clean

4--Execute-Clean-Command

Step 5: Create Primary Partition

Now, it is time to make the driver, the Primary Driver. It will help to reaccess the driver in the future for the OS installation process.

Command: create partition primary

5--Make-Primary-Partition

Step 6: Format the Disk

As soon as the above step is complete, the File Explorer will prompt one window. Click on the Format Disk option to complete the process.

6--Click-Format-Disk

Conclusion

Formatting a hard drive using Command Prompt is a straightforward process that gives you more control over your disk management tasks. By following the steps outlined in this guide, you can confidently format a hard drive in Windows CMD, preparing your drive for new data or wiping it clean. Whether you’re troubleshooting, setting up a new drive, or simply clearing space, knowing how to format a disk using CMD is an essential tool in any Windows user’s toolkit.

Все способы:

  • Вариант 1: Команда FORMAT
  • Вариант 2: Утилита Diskpart
  • Вариант 3: Форматирование с удалением разделов
  • Вопросы и ответы: 0

Приведенные ниже способы позволят отформатировать не только жесткий диск, но и SSD-диск и любой сторонний накопитель, например, внешний HDD или флешку.

Вариант 1: Команда FORMAT

Для форматирования накопителей в Windows (причем во всех версиях ОС) предусматривается специальная команда – FORMAT. Она позволяет удалить все содержимое с раздела диска, то есть она очищает разделы по отдельности, если он разбит на несколько, причем с помощью данной команды можно по очереди их отформатировать, но объединены они не будут.

  1. Для любого способа, предполагающего форматирование диска с помощью «Командной строки», консоль нужно запускать с расширенными правами. Можете отыскать средство с помощью строки поиска (запрос cmd), затем выбрать «Запуск от имени администратора».
  2. как отформатировать диск через командную строку-01

  3. В окне открывшейся консоли введите команду format d: /fs:fat32 /q, где на нашем примере под d: подразумевается буква раздела, который нужно отформатировать.

    Следует отметить, что команда /fs: определяет тип файловой системы. В нашем случает это FAT32, но вы можете заменить значение на ntfs, чтобы новый раздел был с соответствующей файловой системой. Параметр /q – это быстрое форматирование. Если же его не указывать, тогда будет выполнено полное форматирование.

    Нажмите на клавишу «Enter», чтобы выполнить запрос и начать форматирование раздела диска.

  4. как отформатировать диск через командную строку-02

Иногда может появляться сообщение «Вставьте новый диск в дисковод» с указанием буквы. Нажмите на клавишу ввода для продолжения операции. Бывает, что консоль предлагает вручную указать метку тома, можете ввести букву, под которой будет отображаться раздел в штатном «Проводнике» и нажмите на «Enter». После того, как операция будет завершена, отобразится соответствующее сообщение.

Вариант 2: Утилита Diskpart

С помощью предустановленной утилиты Diskpart, которая также запускается через «Командную строку» в Windows, можно управлять всеми разделами и дисками на компьютере. То есть с ее помощью получится не только отформатировать накопитель, но и удалить разделы или создать новые. Причем работает она и с флешками. Разберем, как очистить раздел с использованием Diskpart:

  1. В запущенной от имени администратора «Командной строке» выполните запрос diskpart, запустив таким образом утилиту.
  2. как отформатировать диск через командную строку-03

  3. Чтобы отобразить все имеющиеся в системе разделы, введите команду list volume и нажмите на клавишу «Enter». В перечне найдите тот диск, который нужно форматировать, и запомните его номер. Он будет использоваться в дальнейшем.
  4. как отформатировать диск через командную строку-04

  5. Выберите для работы нужный диск, выполнив запрос select volume N, где под буквой «N» используйте свое значение (Шаг 2).
  6. как отформатировать диск через командную строку-05

  7. Для запуска операции форматирования введите format fs=fat32 quick, где вместо FAT32 можете написать ntfs, чтобы отформатировать раздел в этой файловой системы. Параметр quick – это запуск быстрого форматирования. Если нужно полное, то его не добавляйте в команду. Нажмите на «Enter» для выполнения.
  8. как отформатировать диск через командную строку-06

  9. После операции вы увидите, что форматирование успешно завершено. Если нужно очистить другой раздел, проделайте все то же самое, начиная с Шага 3. Закройте утилиту Diskpart с помощью команды exit.
  10. как отформатировать диск через командную строку-07

Как уже говорилось, мы рассмотрели способ с Diskpart, который предназначен исключительно для форматирования одного из выбранных разделов. Если же нужно удалить какие-то из них или объединить, порядок действий будет несколько отличаться, о чем мы поговорим в следующем разделе статьи.

Вариант 3: Форматирование с удалением разделов

Если нужно, помимо форматирования, удалить имеющиеся разделы, создав один, тогда действовать нужно согласно инструкции ниже:

  1. Проделайте то же самое, что и в предыдущем алгоритме на Шаге 1, чтобы запустить утилиту Diskpart в окне консоли. Теперь, в отличие от предыдущего способа, нам нужно отобразить список дисков, а не разделов. Для этого выполните команду list disk.
  2. как отформатировать диск через командную строку-08

  3. Выберите накопитель и используйте его номер в команде select disk N.
  4. как отформатировать диск через командную строку-09

  5. Используйте команду clean. Она удаляет раздел, сделав все пространство на нем незанятым.
  6. как отформатировать диск через командную строку-10

  7. Следующий запрос, который нужно ввести и выполнить, — это create partition primary. Он создает новый том.
  8. как отформатировать диск через командную строку-11

  9. Теперь аналогичным с Шагом 4 Варианта 2 способом отформатируйте новый раздел, который получилось создать путем удаления подразделов этого диска, с помощью запроса format fs=fat32 quick (можете указать другую файловую систему, например, exFAT или NTFS). Завершите работу утилиты с помощью exit.
  10. как отформатировать диск через командную строку-12

В итоге на диске будет один отформатированный раздел, а не несколько, как было ранее.

Наша группа в TelegramПолезные советы и помощь

Formatting one of the best hard drives or SSDs is the same as buying a new hard drive since the process erases all the data in one fell swoop. When you format your hard drive, you can clean internal as well as external storage media.

In this tutorial, we explain how you can format a hard drive using the command prompt. Before proceeding further, make sure you backup all available data to prevent data loss. Follow the steps below to format a drive:

STEP 1:    Open Command Prompt As Administrator

Opening the command prompt.

Opening the command prompt.

Search for command prompt, right click and run as Administrator.

STEP 2:    Use Diskpart

Using diskpart

Using diskpart

Once command line is open, type ‘diskpart‘ and press Enter.

STEP 3:    Type List Disk

Using list disk

Using list disk

The above command will open a Diskpart window. In this window, type ‘list disk‘ and press Enter. It will list all the available drives.

STEP 4:    Select the Drive to Format

Formatting a drive.

Formatting a drive.

Now type ‘select disk (disk number)‘ as shown above. Specify the drive number which needs to be formatted.

STEP 5:    Clean the Disk

Using the clean function.

Using the clean function.

In this step, type ‘clean‘. This command will permanent delete all files and folders, and successfully clean up the disk.

Get Tom’s Hardware’s best news and in-depth reviews, straight to your inbox.

STEP 6:    Create Partition Primary

Creating primary partition.

Creating primary partition.

To make the drive again accessible, type ‘create partition primary‘.

STEP 7:    Format the Drive

Formatting a drive.

Formatting a drive.

Now format the drive with FAT or NTFS file system. Type ‘format fs=ntfs‘ and press Enter.

STEP 8:    Assign a Drive Letter

Assigning a drive letter.

Assigning a drive letter.

To assign a drive letter, you can type ‘assign‘ as shown below.

MORE: How to Enter the BIOS on Any PC

MORE: Windows How-To Articles

Here on this page, we’ll include two free methods, diskpart format command and free third-party manager, to help you quick format or fully clean up a hard drive on Windows 10/8/7 with ease:

Workable Solutions Step-by-step Troubleshooting
Fix 1. DiskPart Alternative — Free Formatting Tool
  • Run DiskPart alternative — EaseUS formatting tool
  • Right-click hard drive and choose a format
  • Choose file system, cluster size…Run DiskPart Format Alternative
Fix 2. DiskPart Quick Format Command
  • list disk
  • select disk *
  • list volume
  • select volume *
  • format fs=ntfs quick…Use DiskPart Format Command
  • Video Guide

Formatting hard disk, USB flash drive, pen drive, and memory card, etc., is meaningful and helpful in solving some device issues. For examples:

  1. 1. Incompatible or unsupported file system on a hard drive blocks the computer from recognizing it. 
  2. 2. Switch hard drive format, change hard drive to NTFS, FAT32, exFAT, etc., for specific usage.
  3. 3. Restore the drive to full size when it only shows partial storage or half-size.
  4. 4. Fix RAW, corrupted, or inaccessible errors on hard drives.

DiskPart Format Command and Alternative — DiskPart vs EaseUS Formatter

Generally, there are three ways to initiate the task:

  • Windows quick format (by using File Explorer or Disk Management)
  • Windows DiskPart command
  • A free third-party hard drive format tool — EaseUS Partition Master

Click to download EaseUS formatting tool for free here:

Windows quick formatting is easy to get started but with limited functions, so the latter two options become better choices. Check the comparison list between DiskPart Format Tool and EaseUS Partition Master, and learn which is better for you to refer to:

DiskPart — CMD Format Command EaseUS Partition Master Free
  • Free
  • Quick format with cmd
  • Support clean disk
  • Format disk to FAT32/NTFS
  • For advanced users
  • No tech support
  • Free
  • Quick format hard drive
  • Support clean disk
  • Convert FAT32 to NTFS without formatting
  • Format devise to FAT32/NTFS/EXT2/3/4/exFAT, etc.
  • For all levels of users
  • Email & online tech support are available

Your Quick Guide:

  • As a beginner, you can trust the free formatting tool as a DiskPart alternative to format disk in Fix 1. 
  • For experienced users, running the DiskPart command to format the disk is quick with instructions in Fix 2.
Notice:
As formatting will clean up the hard drive data completely, to avoid unnecessary data loss, make sure to back up all important data in advance before taking the operations.

Fix 1. Format Disk CMD Alternative — EaseUS Partition Master

The other easier way to format disk, compared to Diskpart, is to apply a free DiskPart alternative formatting tool for help. Here we’d like to recommend you try EaseUS Partition Master Free.

It enables you to quickly format or clean up an internal HDD, an external USB stick, pen drive, or an SD card, etc. within only a few simple clicks. 

The whole process is simpler and smoother than formatting a hard drive using the DiskPart command prompt.

# 1. 4-Steps: Quick Format Hard Drive using DiskPart Format Alternative 

Download EaseUS free disk formatting tool and follow the guide below to see how to format the disk.

Step 1. Run EaseUS Partition Master, right-click the hard drive partition you intend to format and choose «Format».

Format Hard Drive Partition - Step 1

Step 2. In the new window, set the Partition label, File system (NTFS/FAT32/EXT2/EXT3/EXT4/exFAT), and Cluster size for the partition to be formatted, then click «OK».

Format Hard Drive Partition - Step 2

Step 3. Then you will see a warning window, click «Yes» in it to continue.

Format Hard Drive Partition - Step 3

Step 4. Click the «Execute 1 Task(s)» button to review the changes, then click «Apply» to start formatting the partition on your hard drive.

Format Hard Drive Partition - Step 4

Does this fix work? If you have removed your issue, you can share this article to help more people.

To use DiskPart to format a disk, you need to follow the commands below carefully. Any mistakes will cause serious problems.

Here we’ll take the method of formatting hard drive using CMD on Windows 10 as an example to show you to detail steps:

#1. Format Disk Using CMD — DiskPart Quick Format Command

How to format disk using CMD:

Step 1. Right-click on the Windows icon, select «Search» and type: command prompt.

Right-click on Command Prompt and select «Run as administrator».

Step 2. Type diskpart in Command Prompt and hit Enter.

Step 3. Type format command lines in DiskPart and hit Enter each time so as to quick format the hard drive:

  • list disk
  • select disk 2 (Replace 2 with your disk number)
  • list volume
  • select volume 10 (Replace 10 with the volume number of the partition that you want to format)
  • format fs=ntfs quick(If you need to format a hard drive partition to FAT32 or other file systems, replace NTFS with FAT32, exFAT, etc.)
 Warning
If you input format command without «fs=ntfs quick or fs=fat32 quick« in DiskPart, it will execute a full format on your selected hard drive partition.
This command will erase all saved data sector by sector without data recovery chance. In other words, you’ll permanently lose all saved data on the disk. So please double-check and confirm that you’ve input the right command before hitting Enter.

Step 4. Type exit and hit Enter to close the program when DiskPart reports it has successfully formatted the volume.

Quick format hard drive with diskpart command.

That’s a complete guide to formatting a hard disk with DiskPart quick format commands.

Video Tutorial: How to Format a Drive using CMD Format Command

  • This tutorial will show how to format a hard drive with the command-prompt-based utility — DiskPart.

#2. Fully Clean and Format Disk Using CMD Command in DiskPart

If you prefer to completely wipe the hard drive, clean and format a hard drive using the CMD command, follow the operations using DiskPart for help.

Step 1. On Windows 10, press Windows + X, select «Search», and type command prompt, right-click on it and choose «Run as administrator».

Step 2. On the Command Prompt black window, type diskpart and hit «Enter».

type diskpart to format hard drive with command prompt

Step 3. Now type list disk and press «Enter».

All the disk drives will be listed, including your external drives that are connected to the computer.

type list disk to format hard drive with command prompt

Step 4. Type select disk + disk number, for example, select disk 2 and press enter.

It tells DiskPart to locate and lock disk 2 so as to clean and format it with the continuing steps.

type select disk 1 to format hard drive with command prompt

Step 5. Go on to type clean. This step starts to clean up all files and folders on the selected hard disk.

type clean to format hard drive with command prompt

Step 6. Type create partition primary and press «Enter».

type create partition primary to format hard drive with command prompt

Step 7. After DiskPart successfully created the specified partition, type format fs=ntfs (or format fs=exfat) and press «Enter».

It tells DiskPart to format the disk to a specific file system, let it be NTFS, exFAT, etc.

type format fs=ntfs to format hard drive with command prompt

Step 8. At last, assign a drive letter to the newly created partition by typing assign.

type assign to format hard drive with command prompt

Step 9. Type exit to close the DiskPart Command Prompt window when the process finishes.

Bonus Tip: Clean Up Hard Drive by Erasing Disk

Compared to the DiskPart clean command, EaseUS BitWiper — a newly released disk wipe software by EaseUS simplifies the whole process of cleaning up a hard drive.

With it, you can simply erase everything on a hard drive, leaving it as an empty new drive with full size:

Step 1. Run EaseUS BitWiper. Click the «Wipe Disk» tab.

wipe disk 1

Step 2. Select the targeted HDD or SSD to wipe.

Notice: Please make sure you have chosen the correct HDD or SSD. Once the wiping starts, your data is irrecoverable.

wipe disk 2

Step 3. Choose Wiping Method and click «Next».

Choose a suitable wiping method. Recommend EaseUS Secure Erase!

wipe disk 3

Step 4. Check the warning message and click «Wipe» to confirm.

wipe disk 4

Step 5. Wait for wiping finish and click «Done».

wipe disk 5

Bottom Line — How to Format A Drive in Hard Disk with Run

On this page, we included two major free methods to help you clean and format a hard drive disk: DiskPart format command lines and DiskPart alternative — EaseUS free formatting tool.

According to many Windows managers and experienced users, you may also try to format a hard drive by using File Explorer and Disk Management on your own.

For quick and smooth operation, EaseUS Partition Master Free should be your best shot.

People Also Ask About Diskpart Format Command

If you are having further DiskPart formatting questions, check the following questions and listed answers for help.

1. How do I use Diskpart?

As DiskPart can execute many operations via different command lines, here we concluded a few of them to help you managing hard disk.

To create a partition: (Open Command Prompt and hit Enter each time.)

  • diskpart
  • list disk
  • select disk 1
  • create primary partition size=10000mb (or more)
  • format fs=ntfs (or other file systems)
  • assign letter=D (or other drives)
  • exit

You may also run the DiskPart command to perform the following operations:

  1. #1. Show hidden files using CMD
  2. #2. Check and fix disk error using cmd
  3. #3. Recover deleted files using command prompt
  4. #4. Fix and repair hard drive errors using CHKDSK command

2. How long does DiskPart take to format?

Being it similar to the Windows formatting feature, you can always apply DiskPart format command to format a hard drive within minutes or half an hour, depending on the hard drive capacity and used space on it.

As estimated, to do a ‘full’ format on a 1TB hard disk in Windows, will take a long time, like 2- hours, and over a USB 2.0 connection, it may take a day!

3. What is the command to format a partition with the NTFS file systems?

Follow the process to format a partition with NTFS file system:

  1. 1. Right-click Windows icon, «Search», and type «CMD» and then right-click Command Prompt to select «Open as Administrator»
  2. 2. Type «list disk» into the command prompt without quotes and hit Enter.
  3. 3. Type «select disk 1» without quotes and hit Enter. (Replace 1 with the disk number of your own hard drive.)
  4. 4. Type «list volume» without quotes and hit Enter. 
  5. 5. Type «select volume 1» without quotes and hit Enter. (Replace 1 with the target partition number on your drive.)
  6. 6. Type «format d: /fs: ntfs quick» without quotes and hit Enter. (Replace d: with the drive letter of your target partition.)
  7. 7. Type «exit» and hit Enter to close the command prompt.

For further resolutions, check the How-To page or use the Search option on our website — https:www.easeus.com to find more exact solutions bases on your issues. 

4. How to format a USB flash drive using CMD? — Quora.com

Step 1. Connect USB to PC and press Windows + R keys.

Step 2. Type cmd in the Search box and hit Enter to bring up Command Prompt.

Step 3. Type the following command lines one by one and hit Enter each time:

  • diskpart
  • list disk
  • select disk + X (Replace X with the number of your USB drive.)
  • list volume
  • select volume + N (Replace N with the volume number of your USB flash drive.)
  • format fs=ntfs quick (You can also replace NTFS with FAT32 or exFAT.)
  • exit

Which command formats a disk partition?

The answer is: diskpart format command that does the job of disk management using cmd on Windows.

If you want to format an internal hard drive or format external hard drive using cmd diskpart, this tutorial will show you the detailed steps.

This article includes the following

  • Diskpart format a new hard disk/usb hdd
  • Diskpart format an old disk/external hdd
  • Diskpart format disk alternative — disk management
  • Software format disk — IM-Magic Partition Resizer

diskpart format disk ntfs/fat32/exfat quick Windows cmd

Format a new hard drive or external hdd with diskpart cmd

If your hard drive or portable hdd is a new bought disk, you may try the following steps to get it formatted.

The key: to get it initialized at first and then format.

Also read: how to initialize disk

Alternative: Initialize new disk under disk management

Initialize disk in disk management

Video — how to add, initialize and format a new disk in Windows 10

Diskpart format an old hard disk or external hard drive

If your hard drive or external hard drive is a healthy working disk, try the following steps to get it formatted.

Preparation — Open cmd and type diskpart to get started.

format disk cmd diskpart

  • type ‘list disk’
  • type ‘select disk *’
  • type ‘attibutes disk clear readonly’
  • type ‘clean’
  • type ‘create partition primary’
  • type ‘format fs=fat32’ or ‘format fs=ntfs’ (with/without quick; fat32/ntfs/exfat depends on what kind of file system you want; if you have no preferance, just go with ntfs.)

diskpart clean sd card

Format a disk vs format a partition using diskpart cmd

The difference comes with disk may contain more than 1 partition. If a disk is a whole partition itself, then go with the above steps.

If there are more than two partitions on the disk, the above steps would get all partitions formatted.

If you want to format just one partition on the hard disk instead of the whole, you need to go more further with the following steps.

  • run cmd and type diskpart to start
  • list volume
  • select volume * (the one that you want to get it formatted)
  • format fs=ntfs quick

Note: list volume cmd would show all found volumes on your computer and it would be easier for you to select what you want to format, get it selected, and then go with diskpart format fs=ntfs or fat32, or exfat per you need.

Our advice: disk management is much eaiser than diskpart cmd.

Diskpart format disk alternative — disk management

Here we would show you how to use disk management on Windows 10/7 to do the job of Windows 10 format command line to format drive instead of cmd.

  • Format by disk management
    format raw usb flash drive

    Video — how to format in disk management

  • Format by Windows explorer right click format option

Also read: 8 free ways to format disk/usb; or how to format drive ntfs

Cannot format hard drive?

Windows unable to format? Recommend: Unable to format hard drive fixes, or cannot format pen drive fixes

Free Software to Format, Repair Hard Disk Using IM-Magic Partition Resizer

IM-Magic Partition Resizer is a free Windows disk utility that can not only format a hard disk but also clone it, migrate OS, upgrade to a larger disk, repair logical errors, and regenerate hard disks.

Download Free for Win 11-7

Part 1: Format Hard Disk Using Partition Resizer

Note: Formatting will erase all data on the hard disk, so please back up your data first.

  1. Step 1: Right-click the hard disk in Partition Resizer, choose ‘Format Partition’, and set it to NTFS, FAT, or FAT32.
  2. Step 2: Click ‘Apply Changes’ in the software to start formatting the hard disk.
    format hard disk

Part 2: Clone the Damaged Hard Disk to Another Drive for Free Using Partition Resizer

  1. Step 1: Download the free tool, and connect your hard disk to the PC.
  2. Step 2: Right-click the hard disk in the software, and choose the option «Copy Disk» to start the cloning process.
    clone damaged hard disk

  3. Step 3: Choose the target drive for the hard disk backup (Prepare a larger drive or another hard disk as the destination for backup).
  4. Step 4: Click ‘Apply Changes’. It will begin to clone your hard disk.

Part 3: Remove Hard Disk Write Protection Using Partition Resizer

  1. Step 1: Right-click the hard disk in Partition Resizer, and choose ‘Remove attribute read-only’.
  2. Step 2: Click ‘Apply Changes’ in the software to remove the write protection on the hard disk.
    remove hard disk write protection

FAQs

Is Diskpart Windows 10 disk management command line?

Answer: YES. Windows disk management provides a user interface that is more easier to manage disk volumes while command line diskpart is for advanced professionals. And there is no difference among diskpart Windows editions no matter 7 or 10.

How do I use diskpart to clean and format a drive?

Answer: Diskpart to clean and format a drive? Just go ahead with the following steps.

  • Run cmd and type diskpart to start
  • list volume (a list of drives will show up)
  • select volume *
  • clean
  • format fs=ntfs quick
  • exit

The above steps shows how to clean and format a drive using diskpart cmd on Windows pcs.

Also read: how to use diskpart format cmd

Related articles

  • format fs=ntfs quick
  • diskpart format raw ntfs
  • diskpart format usb
  • diskpart fix raw partition
  • diskpart format disk gpt
  • diskpart clean
  • diskpart create partition
  • diskpart delete partition
  • fix raw partition without losing data

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Контроллер домена windows это
  • Копировать как путь windows 11 что это
  • Как отключить antimalware service executable в windows 10 домашняя
  • Сколько места на диске занимает windows 10 домашняя
  • Windows presentation foundation unleashed на русском