Commands for formatting a flash drive via the command line. Command line as a tool for formatting a flash drive. What types of formatting are there?

Many people periodically have to deal with the problem of copying a file weighing over 4 gigabytes to a flash drive. In Windows 7 and Windows 8, NTFS formatting is available by default, while the NTFS format is not supported in Windows XP.

So, how to format a flash drive for NTFS in Windows XP.

What are FAT and NTFS

FAT and NTFS are a file system that is a way of organizing and storing data on media (flash drive, hard drive). Information must not only be recorded, but also organized. A simple way to organize information is through files and folders.

Today, the most common file system on user computers is NTFS, which replaced FAT.
The FAT file system is very rare on modern computers. The main disadvantage of this file system is that it has a maximum disk capacity of only 2 gigabytes.

This file system appeared on computers relatively recently. The system has greater advantages than FAT. But it also has its drawbacks. NTFS stores data much better, but is also demanding on computer resources. In addition, if the hard drive is over 90 percent loaded, the system will start to work slower.

Thanks to NTFS, it is now possible to recover lost data.

When to format a flash drive

Formatting is the process of creating a file system on a drive. After formatting, all stored data is deleted.

Formatting a flash drive is carried out for a number of the following reasons:

  • not enough free space;
  • changing the file system;
  • troubleshooting;
  • The drive was damaged by viruses.

Determining the cluster size

When performing formatting operations, you can specify not only the file system, but also the required cluster size. Because of this, most users wonder what cluster size should be set when formatting.

The cluster size must be selected taking into account what files will be stored on the flash drive.

If the files that will be stored on the flash drive are small ( text documents, photographs, etc.), then you should choose a small cluster volume. If the disk is intended to store large volumes of files (music, video), then it is best to choose a large cluster size.

A cluster is a minimum unit of capacity that is allocated on a flash drive for storing data. Main feature filling clusters when placing data on them is to create a mark indicating that the cell is full (this occurs even if the cell is not completely filled).

If the cluster size is 256 bytes, and the file stored in it is only 1 byte in size, the cell becomes unsuitable for writing and storing other files. The cluster size also affects the speed of data exchange between the PC and the flash drive.

File systems have different ranges of cluster sizes:

  • FAT – cluster size is 64 kilobytes (65536 bytes).
  • FAT32 – cluster size ranges from 1 to 32 kilobytes (1024–32768 bytes).
  • NTFS – cluster size ranges from 0.5 kilobytes to 32 kilobytes (512–65536 bytes).
  • exFAT – cluster size ranges from 0.5 kilobytes to 32 megabytes (512–33554432 bytes).

How to format a flash drive for NTFS

In order to correctly format a flash drive in the system in NTFS under Windows XP, you first need to change the drive optimization.


The correct procedure for formatting flash drives includes the following points:

  • In My Computer, select the flash drive and right-click on it. In the list that opens, select Format...;
  • then a window will appear in which you need to select a file system;
  • after this, you need to set the cluster size (how to choose the cluster size was discussed above);
  • Next, set the volume label;
  • and click on the Start tab.

After all the steps, the flash drive will be formatted in NTFS under Windows XP.

It is known that the FAT32 file system prevents copying a file that weighs more than 2 gigabytes. Therefore, users often have a problem regarding how to format a flash drive from FAT32 to NTFS.

There are several ways to format a flash drive correctly in the system.

Convert files without data loss

To avoid losing data during conversion, you can use the standard “convert.exe” utility, but first you should check the disk for errors.

  1. you need to right-click on the flash drive and select Properties in the drop-down window;
  2. then you need to go to the service and select Perform check;
  3. After clicking on the Run scan tab, the Scan disk window will appear; in the Scan parameters you must check all the boxes.

It is advisable to close all programs in use before converting to avoid errors during the operation, which could result in lost access to the disk.

The utility is located on local disk(C:)/Windows/System32/convert.exe.

You can call it by typing the command line:


In the window that opens, you need to specify the following data: convert -> (removable drive letter) -> : /fs:ntfs /nosecurity /x.

Then you should press Enter. After the conversion is completed, you must enter exit and press Enter again. This utility allows you to convert a file system without losing data via the command line.

Additional keys to the convert utility:
Convert volume: /FS:NTFS :

  • Volume—defines the drive letter;
  • /FS:NTFS - defines the file system;
  • — activates the message input mode;
  • - points to a file in the root folder to reserve space for system files NTFS;
  • /NoSecurity - this parameter is responsible for the security of converted files;
  • /X - force removal of the volume.

Despite the fact that Convert.exe allows you to convert the file system of a flash drive without losing data, before starting work it is still better to copy the data from the flash drive to your hard drive.

To avoid mistakes during conversion, you need to check the flash drive for free space.

In addition, you can use a free utility to format a flash drive from FAT32 to NTFS. Utility name HP USB Disk Storage Format Tool.

Algorithm of actions:


To understand how to format a flash drive from exFAT to NTFS, you must first understand this concept.

The exFAT file system, which replaced the FAT system, has the following differences:

  • reduction of overwrites of the same disk sector;
  • increasing the cluster size to 32 megabytes;
  • magnification maximum permissible size file up to 16 exabytes;
  • there is no limit on the number of files in a directory;
  • support for access rights to files and directories has appeared;
  • The efficiency of using free space has increased significantly, thereby significantly reducing disk fragmentation.

Video: How to format a flash drive to NTFS

To format a flash drive from exFAT to NTFS, you need to open the command line window: Start -> Run -> cmd. To format, use the format command with the /FS switch:

Example command: format Z: /FS:NTFS

To format a flash drive in exFAT, you need to type the following command: format Z: /FS:exFAT

The exFAT file system consumes significantly less disk space for its system resources. It supports files that weigh more than 4 gigabytes.

If the flash drive is small and involves storing small files, then it is better to format it to the FAT32 system. It is best to format a large flash drive in exFAT. For external hard drives, which have a USB 3.0 connector, the ideal solution would be to format it to NTFS.

This article examined file systems, methods for formatting them, as well as formatting a flash drive for NTFS in Windows XP.

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 associated 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 flash drive.
  2. Another option is that you want to completely clean the media from viruses and malicious software.
  3. Change the file system format. For example, from FAT32, where there are restrictions on the size of written files, to NTFS.
  4. Tired of the slow performance of your flash drive? Or does the device not see it, but only displays a window with errors when connecting? Formatting will again be helpful and will most likely fix the problem.
  5. Also, quite often, users resort to this procedure if they need to fix errors on the drive that interfere with reading or writing files.
  6. If you need to create a bootable USB flash drive, then again you cannot do without formatting.

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

Via the Format command

This is the most common method. With it, formally, you do everything the same as if you were using standard Windows tools. But in this case the command line is used. There is nothing complicated about this:


In addition, instead of the above command, you can enter another slightly modified one. It looks like this – “Format /FS:NTFS H”. “N” – in this case, 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 is not working well, information cannot be read from it, and new data, on the contrary, is not written, then you can only resort to a last resort - low level formatting. To do this, use not the command line, but special utility. For example, HDD program Low Level Format Tool.

Using the "diskpart" utility

There is another way to format a flash drive via the command line. In this case, a special utility built into the OS is used, which is used to manage disk space. It's called diskpart.

To use it to format the drive, do this:


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

What else should the user know? Working on the command line with the built-in diskpart utility is recommended in cases where the 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 using the method described above.

Format the flash drive using the SDFormatter utility

In case formatting methods via the command line do not suit you (for example, they seem inconvenient), we can recommend the graphical utility SDFormatter. It contains only two formatting options, but allows you to configure the cluster size. You can download the program from

It often happens that many modern computers do not have a disk drive. This often causes difficulties, especially when it is necessary to install a program with installation disk. Most often, the problem occurs when installing or reinstalling the Windows operating system on such a computer. To avoid such problems, it is proposed to create bootable usb drive, which will perform all functions exactly like the installation disk.

To create bootable usb drive or sometimes it is also called a bootable USB flash drive using the command line “cmd”, you need to perform a simple algorithm of actions in two steps. The first stage will involve using a standard utility called diskpart.

How diskpart works

Creating a bootable flash drive through the console utility diskpart is fast and affordable way. Due to the fact that this utility works in text mode, each user personal computer can easily cope with this task.

With the rapid development of technology, everyone has access to the Internet, where they can find free versions various programs for creating a bootable flash drive. However, it also happens that there is no access to the Internet due to some circumstances, so it is important to know a few simple alternative ways creating a bootable flash drive.

One of them is the described method using the command line. Such manual method will be useful to every PC user. This console utility is included in the list standard programs. There is no need to additionally search for and install any other programs to configure a bootable flash drive. After ten minutes of use, diskpart is ready bootable flash drive with the Windows installation file.

Preparing a flash drive using diskpart

Diskpart- this is a console system program, included with Windows, through which you can manage disks, partitions and volumes by directly entering commands.

Creating a bootable flash drive using the command line will be shown clearly. The operating room will be used as an example. Windows system 8. On other versions of the Windows operating system, such as Windows 7 or Windows 10, the creation process will be identical.

Before starting work you must connect a portable disk or flash drive, or other removable media to your computer. Such a device will be further referred to as a flash drive.

Then press the Win + X key combination or right-click in the lower left corner of the screen. For those who still know what this Win button is, we remind you:

Select menu item " Command line(administrator)».

If it is more convenient for you to call the window “ Execute"using Win + R, you can do this by entering in the window that opens " cmd" and clicking OK. These actions will lead to a similar result.

In the window that opens, type diskpart and press the Enter key.

Of course, it is more likely that the need to create a flash drive will not arise from the operating system, where there are simpler and convenient ways, but from a clean command line while restarting the PC.

After this, you need to enter the data in the same way as shown in the picture below. After each command entered, press the Enter key.

  • list disk– a list of available disks will be displayed;
  • select disk #– instead of #, enter the number of the disk that is a flash drive, it will be bootable (in the example, this is disk number 1); It is easy to distinguish a flash drive from other disks by its size;
  • clean– the disk will be cleaned, all previous information will be deleted
  • create partition primary– a special section is created
  • active– the section is activated
  • format fs=ntfs quick– the disk will be formatted
  • assign– the disk name will be assigned and the connection point will be assigned
  • exit– the operation is completed. This will exit the command line.

The first stage of creating a bootable flash drive is complete.

Copying files to a flash drive

The next stage will be copying installation files programs on a flash drive. You need to copy all files completely with their entire structure and directories.

This can be done using standard tools Windows type"Conductor". If you want due to different possible reasons To do this using the same command line, the following commands will help you with this:

  • Improved copy command " robocopy", unlike the legacy "copy", can copy subfolders with all their contents. The first argument of the command is the path to the files to be copied, and the second is the path to the folder into which the files will be copied. To copy subfolders you need to add a third argument " /E", otherwise only the files will be copied. For example, to copy all the files from drive f to a flash drive named g: you need to enter the command: robocopy f:\ g:\ /E
  • Deprecated file copy command " copy", using which you can copy only files (folders will have to be created manually with the "md" command). The first argument of the command is the path to the files to be copied, and the second is the path to the folder into which the files will be copied. To make it clear to the command that you want to copy not just one file in a folder, but all files, specify the code “*.*” as the file name.
  • The disk change command, the format of which is: DISK: . Those. to go to drive “D:\” you need to enter the following command: d:
  • To select a directory located in the current folder, enter CD <имя директории>eg: cd win10
  • To go to the top level of the file hierarchy, type cd \
  • To go to the parent folder, write cd ..
  • To view a list of files in the current folder, enter the command dir
  • To create a folder, run the command md <имя папки>

Knowledge of these commands is enough to successfully copy files to a flash drive.

This is what it will look like if you copy installation files located on the d:\win10 drive and a flash drive named “G:\”. Preparation and launch robocopy:

After a certain time, all files will be successfully copied:

Most often, a bootable flash drive is used to install or reinstall an operating system. If you don't have a disk drive, you can use a virtual DVD drive and an image file.

When installing an operating system from a bootable flash drive, you need to change the settings in the BIOS so that the computer boots through this device.

Video on the topic

The drive format affects the speed of writing and reading information. If your flash drive is slow, it may be time to change its format. We previously wrote about how in a standard way change the media format from FAT32 to NTFS, however, a situation may arise when this method won't work. In this case, the method of formatting the media via the command line will be able to solve the problem.

Formatting a flash drive via the command line

To format a flash drive via the command line, follow these steps:

  • We connect the flash drive and press “Win ​​+ R”. The Run service window appears. Enter the command “cmd”.
  • A command prompt will open. Enter “diskpart” to launch the disk space management utility.

  • Next, enter “list disk” to view the list of drives and determine the number of your flash drive in this list.

  • We remember the disk number and enter the command “select disk 1”, where “1” is the number of the flash drive.

  • Now, after selecting the disk, it needs to be cleared of attributes. The command “attributes disk clear readonly” is intended for this purpose. First we enter it, and then we write “clean”.

  • When the flash drive is formatted, you need to create a primary partition. Enter “create partition primary”.

  • To change the flash drive format from FS to FAT32, you should enter “format fs=fat32” or “format fs=ntfs” to set the NTFS format.
  • The media will begin formatting.

  • At the end of the operation, you should enter “exit” to exit.

Hello friends.

During the time you have been using a flash drive, I think you have noticed that it is often subject to software failures. Fortunately, almost any problem with it is usually solved by formatting.

If you can’t do it using the usual methods, then I’ll tell you how to format a flash drive via the command line. Moreover, this can be done in several ways and any of them will not cause you any difficulties. By the way, this formatting is suitable for various flash drives, including microSD.

Whichever method you use, first run Command Prompt as Administrator.

Don't know how?

One option: find it in the Start menu among the standard programs, then right-click on it and select the appropriate item in the context window.

Or type “cmd” in the OS search bar. And accordingly open the found utility.

Method one - to Format command

This method involves using a command like this:

format /FS:exFAT F: /q

What does it mean?

  • format - a command line explanation of what you want to do with the flash drive. That is, format it.
  • exFAT - file system indication. And if you suddenly have a question about why this particular FS, then you are welcome to read this old one of mine.
  • F: - path to the drive to be formatted, or rather its root directory. If you have it located under another letter, you should indicate it accordingly.
  • /q - means quick cleanup.

Well, how about formatting??

Your actions are:

  1. Form a team as needed in your case.
  2. Enter it where the cursor is blinking.
  3. Press Enter.
  4. Next, a notification will pop up: “Insert new disk into drive H: and press Enter..." Since the drive is already inserted, we perform only the second instruction.
  5. After this, you will see the following message: “Volume label (N number of characters, Enter - no label needed).” Click the same button again.

Now the flash is clean.

Method number two - inbuilt utility Diskpart

Use this option only if for some reason you did not like the first method. Well, or something didn’t work out there.

The Windows operating system has a standard utility that allows you to work with disks, including formatting them. To do this, you need to give the command line several tasks one at a time.

Below I will give their order and notation:


I hope I could help you in some way.

Maybe your friends also encountered a similar problem? Share this article with them on your social media pages.

Review