How to format a USB flash drive through the command line and what are the ways?
Removable USB flash drives accounted forformatted quite often, not only to completely clean them from the available information, but also to create bootable media or in the event of file system corruption due to some malfunction. And not always built-in tools of Windows-systems can cope with this task. Therefore, the question of how to format a USB flash drive via the command line of Windows 7, previous or subsequent versions, becomes very relevant. In this case, you can offer users three basic options for action, two of which are very similar to each other.
The main problems when formatting the USB flash drive with Windows
The most common problem with whichWindows users encounter when trying to format removable media, is that the process seems to be started first, but it does not reach the end.
Even with the selection of any standard parametersthe system reports that Windows can not generate or finish formatting. Why is this happening? Yes, only because the drive has a software or physical damage. No matter how good Windows-systems are, fix the situation with standard methods does not work.
Next, we will consider the problem of howformat the USB flash drive through the command line (Windows 10 will be applied or XP, it does not matter at all - the proposed methods work in all operating systems of this type). But first you need to consider a few key points.
Which format should I prefer?
So, before deciding howformat the USB flash drive through the command line, you should determine the type of file system that will be installed on it after the process is completed. Since we are talking about Windows, systems for Linux and Android will not be considered.
Thus, there are only two options: either FAT32 or NTFS. What to choose? First, pay attention to the amount of memory stick. If it does not exceed 4 GB, you can use FAT32. In the case of a larger size, you will have to select NTFS, since the first version of the file system does not define large volumes. Rather, the device itself determines, but installs for any drive the maximum size is just at 4 GB.
Second, if you create a bootable mediafor computers in which a new UEFI system is installed instead of the aging BIOS, NTFS will not be possible, since such systems are not recognized by this system initially.
Next, we will talk about how to formatflash drive in NTFS via the command line or apply similar actions with the choice of FAT32. Immediately I want to disappoint all lovers of the simplest methods, which tend to use the standard format command without using additional attributes: this approach will prove ineffective.
How to completely format the USB flash drive through the command line using the format command and its main attributes?
Now directly about formatting. The format command for the simplest case needs to be applied not only with the indication of the removable media, under which it is registered in the system, but also add additional attributes.
For example, the user needs to formata flash drive through the command line in FAT32, and the carrier in the system is denoted by the letter F. In this case, the full command will look like this: format / fs: fat32 F: / q (in the above image, drive letter I).
What do the characters in this line mean? The first command is to start the formatting process, the second is responsible for selecting the file system (in this case FAT32), F is the drive letter, the "/ q" attribute indicates that when formatting the volume label (the future name of the media to be displayed in the system) You do not need to create it, and you can do the formatting, so to speak, quickly. If you need an NTFS file system, it is specified on the line itself instead of FAT32. After entering the command, the system prompts you to insert the device into the port, and after that you will need to press the enter key and wait for the process to finish.
How to format a USB flash drive through the command line with the quick addition of a volume label
The second method proposed for review allows you to immediately add a volume label without using additional commands after the formatting process is completed.
In this case, the problem is how to formatflash drive through the command line in this way, is solved due to the fact that instead of the attribute "/ q" the attribute "/ v" (short for English Volume) is used, after which the desired media name is indicated via the colon. The formatting command itself is also slightly modified.
For the flash drive from the previous example, the team looksas follows: format F: / fs: fat32 / v: NAME (in this case NAME is a user-defined name, you can leave the "/ q" operator). Next - the same actions as in the first example.
Using the diskpart sequence
Finally, the longest method to solveThe problem is how to format the USB flash drive through the command line. And if using the first two methods errors can be given, which will be discussed a little later, then this technique provides almost a 100% guarantee of successful execution of the process.
First, the diskpart command is written to the console,After that you will need to enter the line list disk and select the desired device (all partitions are denoted by numbers, so you can determine the desired volume by the size). Then select select disk N (N - number of section number) selects flash drive.
Now the main stage. In some cases, when the media may contain errors or restrictions in terms of the actions applied to them, you may first need to clear the "Read-only" attribute with the attributes disk clear readonly command. This will avoid mistakes in the future. After that, you need to clear the media of all content. To do this, use the clean command.
Further on the medium, a primarysection (the create partition primary command) and only then enter the format formatting command format fs = fat32 (or ntfs) directly. This will be full formatting. If you want to perform a quick formatting, additionally a quick attribute is appended to the line via a space. After the process is completed, the exit command is used. When creating bootable media in an intermediate step, the additional commands select partition primary and active are added.
What should I do if I get a format error?
But with formatting, you can get an error. In particular, this applies to cases when the drive in the system is RAW format, which appeared due to some program failures, which is not recognized in Windows.
To fix the problem, you can first checkdevice from the command console, writing the line chkdsk F: / x / f / r there, but you can also prefer special utilities, among which the palm tree belongs to such software packages as HDD LLF (Low Level Format) and R. Saver.
Short summary
Briefly summarizing, it can be noted thatThe first two methods are very simple, but they should be used only with full confidence in the absence of software crashes and physical damage on the media. But the third method is unique, and it should be used without fail, if after formatting it will be necessary to create bootable media (even using the most powerful applications for this), and also for situations where standard formatting is impossible.