Quick formatting of a flash drive via the command line. Diskpart program encountered an error - Diskpart solutions from seven run in xp

DiskPart is a tool for working with disks, partitions and volumes in the operating system. Windows system. With DiskPart, you can perform important operations such as converting disk types, creating partitions and volumes, and configuring RAID arrays. In addition, DiskPart is used to configure automatic mounting of new disks in file system, to assign drive letters and paths to connected network drives. However, DiskPart is not designed to format drives. For this purpose, the FORMAT command is used.

Launching the DISKPART utility

DiskPart works with physical hard drives installed in the computer. CD/DVD drives, removable media, or USB flash memory cards are not supported. Before using the DiskPart commands, you must list and then select the drive, partition, or volume you want to work on to give it focus. When a disk, partition, or volume has focus, any Disk-Part commands affect that disk, partition, or volume.

Basic DISKPART Commands

To list the available disks, partitions, and volumes, the following commands are assigned:

  • list disk- lists all physical hard drives computer;
  • list volume- lists all disk volumes (including partitions) hard drive and logical drives)
  • list partition- lists the partitions on the drive that has focus.

When using list commands, an asterisk (*) appears next to the drive, volume, or partition in focus. You select a disk, volume, or partition by its number or drive letter, such as disk 0, partition 1, volume 2, or volume D.

When you're done with DiskPart, type exit at the DiskPart prompt to return to the default command line.

DiskPart Usage Examples

To understand how to work with DiskPart, consider the following example, which starts DiskPart, lists the available disks, and sets the focus to disk 2.

  1. To start DiskPart, type diskpart at the command prompt.
  2. The command line will look like this: DISKPART>
  3. This indicates that the DiskPart interpreter is running. To list available disks, type list disk at its command prompt.
  4. The list contains available disks, their status, size and free space: Disk ##* Status Size Free Dyn GptDisk 0 Online 56 GB OB Disk 1 Online 29 GB OB Disk 2 Online 37 GB 33 GB
  5. Since you are going to work with disk 2, you must give it focus by entering the command select disk
  6. DiskPart will report: Disk 2 is now the selected disk
  7. When you're done working with the disk, type exit at the command prompt to exit DiskPart.

Not all users know how to format a flash drive using the command line. Although this method is the most effective and convenient solution that allows you to quickly change the media format. Therefore, we want to tell you in detail about this operation, various related nuances and features.

The formatting procedure may be needed in a variety of situations:

  1. Let's say you need to quickly delete all files stored on a USB flash drive.
  2. Another option - you want to completely clean the media from viruses and malicious software.
  3. Change file system format. For example, from FAT32, where there are restrictions on the size of recorded files, to NTFS.
  4. Tired of slow flash drives? Or the device does not see it, but only displays a window with errors when connecting? Formatting will again be useful and will most likely help fix the problem.
  5. Also, quite often, users resort to this procedure if it is necessary to fix errors on the drive that prevent reading or writing files.
  6. If you need to create bootable flash drive, then again, you can not do without formatting.

As you can see, there are many situations in which this operation is useful and indispensable. Therefore, it will be useful for you to learn how to format a USB flash drive via the command line.

Through the format command

This is the most common way. With it, formally, you do everything the same as if you used the standard Windows tools. But in this case, the command line is involved. In this case, there is nothing complicated:


In addition, instead of the above command, you can enter another slightly modified one. It looks like this - "Format / FS: NTFS H". "H" - in this case, there is the drive we need. If you need to change the file system to FAT32, then the command should look like this "Format / FS: FAT32 H".

For reference! If your flash drive does not work well, information is not read from it, and new data, on the contrary, is not written, then it remains to resort to at least low-level formatting. To do this, use not the command line, but a special utility. For example, the HDD program low level format tool.

Using the diskpart utility

You can start formatting a flash drive through the command line in another way. In this case, a special utility built into the OS is used, which serves to manage disk space. It's called diskpart.

To use it to format the drive, do the following:


Now, after formatting via diskpart, the USB flash drive can be made bootable. Simply copy the distribution files operating system to the carrier.

What else should the user be aware of? Working on the command line with the built-in diskpart utility is recommended in cases where the USB flash drive cannot be formatted in a simple way from the explorer menu. If, when working with removable media, you notice that part of the file system is not visible or for unknown reasons its volume has decreased, then it is also advisable to format it in the manner described above.

Formatting a flash drive with SDFormatter

In case formatting methods via the command line do not suit you (for example, they seem inconvenient), we can recommend the SDFormatter graphical utility. It contains only two formatting options, while allowing you to adjust the cluster size. You can download the program from the link. The functionality is free.

Finally

Through the command line, you can format any USB drive or HDD without resorting to standard means formatting or special utilities. At the same time, even a novice user can easily cope with this procedure. The main thing is to know the commands, as well as be able to correctly and consistently enter them.

Macrorit Disk Partition is a portable program for managing hard disk partitions. Thanks to this tool, you can not only resize individual partitions without formatting them first, but also optimize the overall speed of your HDD/SSD.

The main window of Macrorit Disk Partition displays basic information about the disks installed in the system: total volume, amount of free space, file system and current "health". The program also indicates the partitions and boot areas that are located on each physical media. In order to get more detailed information about disks, select the "Properties" item in the partition's context menu. In the same place (in the context menu) you will find other functions that Macrorit Disk Partition can perform: resizing, copying a partition, changing the label, checking the volume for errors, defragmenting, deleting a partition, formatting, full cleaning and analyzing the media surface. The program also provides a tool for creating boot drives.

Almost every function in Macrorit Disk Partition has a special step-by-step wizard with detailed explanations and tips. The developers from Macrorit did everything to make working with their program as comfortable as possible. It is one of the few hard drive managers that is completely free to use. home use. There is also a paid Professional version that offers users 24/7 technical support and several additional features.

Key features and functions

  • the ability to manage the size of existing partitions without prior formatting;
  • the ability to select new sections and assign them the necessary labels;
  • availability of tools for defragmentation, checking the disk surface, formatting and complete cleaning of data from the partition;
  • the ability to assess the current state of the physical media;
  • the function of creating bootable media;
  • section with detailed information about the sectors;
  • the ability to work in portable mode (without installation in the system).

Lightweight portable program for efficient management of your computer's hard drives. Supports all modern HDD models, works stably with popular file systems, understands both methods of storing partition information without any problems MBR disk and GPT.

Macrorit Disk Partition Expert Free Edition

This is a convenient software shell with advanced tools for managing disk properties. The program has a simple and intuitive graphical interface, which is similar in functionality to similar utilities.

According to the developers of this software from Macrorit, “Even free version Disk Partition Expert surpasses the eminent EASEUS Partition Master and Acronis Disk Director in terms of capabilities and stability.

After starting the program, the main program window is displayed in front of you, the zones of which are divided into areas for displaying information about properties hard drives and control units with tools.

For those users who previously worked in similar programs, the algorithm of actions will be immediately clear.

Main features of Macrorit Disk Partition Expert:

  • Create Boot Disks
  • Migration of partitions with the operating system
  • Partition resizing
  • Redistributing disk space
  • File system conversion
  • Partition copying
  • Change active partition
  • Partition letter control
  • Disc Surface Check
  • Running a defrag
  • Deleting an HDD area
  • Viewing detailed disk properties

If a USB flash drive, memory card or any other type of storage medium does not work properly, cleaning the disk and its partitions using the “Clean” command and the Diskpart tool is one of the ways to solve problems. In this way, problems with a drive that cannot be formatted or whose capacity is displayed incorrectly can be solved.

This trick will also remove partitions that cannot be removed by built-in Windows tools such as Disk Management. This process will completely remove disk partition table, which will allow you to record it again.

Attention: This process will completely erase the entire drive, so be sure to keep your files safe. Also make sure the correct drive is selected, otherwise data may be accidentally deleted from the wrong drive.

Run Command Prompt as Administrator

To get started, run the command prompt as an administrator. In Windows 10 or 8.1, simply right-click on the Start menu and select "Command Prompt (Admin)".

In Windows 7, search for "Command Prompt" in the Start menu. By right-clicking on the mouse, select "Run as administrator".

diskpart

For disk cleanup use the Diskpart command. Before proceeding, make sure that the appropriate USB drive, memory card, or other device you are about to clean is connected to the computer.

To run the diskpart tool, type the appropriate command in the Command Prompt window and press Enter:
diskpart

Display a list of drives installed on the computer by typing the following command:
list disk

View the results of the command and determine the number of the disk that needs to be cleaned.

Be careful! If the wrong disk number is selected, it will be cleared and possibly important data will be lost.

In the screenshot below, you can see that Disk 0 has a capacity of 111 GB, and Disk 1 has 15 GB. We know that we need a 15 GB disk. So Disk 1 is the USB drive and Disk 0 is the computer's internal hard drive.

Once the disk number has been determined, enter the following command, replacing the # sign with the disk number.

Attention: Be very careful. If an incorrect disk number is specified, all data from the wrong disk will be deleted.
select disk#

The specified disk is selected with the diskpart command. Now all actions will be performed with him. To completely clear the partition table, type the following command and press Enter.

Attention: This command will delete everything on the specified drive! Make sure you have copies of all important data before proceeding.
clean

If everything is done correctly, you will see “disk cleanup completed successfully”. Close Command Prompt.

Partitioning and Formatting a Drive

Now, using the Disk Management tool built into Windows, you can create partitions on the disk and format it. You can also use the diskpart command for this, but using the Disk Management tool is much easier.

To launch the Disk Management tool in Windows 10 or 8.1, right-click on the Start menu button and select Disk Management.

Now you will see that the disk you were working with has no partitions. Right-click on the unallocated area and select "Create Simple Volume" to create a partition on the disk and format it with the desired file system. By default, Windows will create one partition the size of the entire drive.

If the described method does not work, for example, the disk was cleaned, but it cannot be partitioned or formatted, or diskpart does not detect it, then the disk is physically damaged and will no longer be able to function normally. But the Disk Cleanup feature via diskpart is a solution that can bring back to life disks that at first glance look absolutely hopeless.

If, despite repeated warnings, you still cleared the wrong disk (and this happens VERY often), do not be discouraged. Data from it can still be recovered. This is a perfect tool for data recovery from Hetman Software - Hetman Partition Recovery.