Formatting a flash drive via the command line
Almost all users have to deal with the command line, sooner or later. Firstly, because all modern versions of Windows are, in fact, graphical shells of the good old disk OS and operations carried out in DOS mode (via the command line) in any case will proceed “directly”, which means faster and more efficiently. Secondly, many settings are not supported by the graphical shell at all, which means they can only be done through the command line.
Formatting a flash drive via cmd
Everyone knows that formatting flash drives (flash drives) can be done under Windows. It would seem, why use the command line (cmd) if you have such a convenient tool? However, experience shows that active viruses, damaged flash drives, and OS malfunctions do not always make it possible to format using standard tools.
In these cases, the fault is also often in the serviceability of the USB ports or their individual contacts, because the system asks you to check whether the drive is connected correctly and to make sure that the disk is not write-protected (and as is well known, flash drives do not have write protection at the hardware level). In this case, the flash drive can be recognized by the system.
Stage 1: Run cmd with administrator rights
Administrator rights may be required to work with cmd. If you are logged into a Windows user account, simply opening a command prompt is not enough.
- To do this, right-click on the command line shortcut and select "Run as administrator".
- After this, in the cmd title you will see the word "Administrator".
Stage 2: Format via the command line
The command line ignores all warnings from the graphical shell and does not require the help of third-party programs; acts directly using disk operating system procedures and commands.
- In order to format the drive via cmd, we need the command "format A:" (if the system recognizes the flash drive as a disk (A:). To find out what letter the system recognizes your flash drive, just go to "My computer". In our case, Windows OS sees the flash drive as "Removable drive E".
- Launch the command line as administrator and enter the following command:
format /FS:NTFS E: /q
This improved command allows the system to:- format the drive with the letter (E:);
- use the NTFS file system;
- perform a quick format. "/Q" means the procedure will be quick. If you need the complete one, just don't use this command.
- format the drive with the letter (E:);
- After clicking on "Enter" the system will ask you to insert a disk (E:). This is a normal procedure, since cmd does not yet know whether you have installed the USB flash drive or not.
- If you make a mistake in the drive name, the command line will immediately let you know.
- After we click "Enter" The command line displays text information about our flash drive and formatting type.
- Click here "Enter". The system structures the file system (the formatting procedure takes place).
- The procedure ends.
Formatting failures on the command line
Despite the fact that the formatting procedure via cmd is the most optimal way to create the file system structure of a flash drive, the command line is not a panacea for all problems. It rarely happens that DOS cannot determine the number of sectors.
Such problems indicate problems with the flash drive. This does not mean that the flash drive immediately after the message "Format failed" should be thrown away. To do this, you need to restore the sectors of the flash drive. After the recovery procedure, almost all drives are successfully formatted and are suitable for reading and writing files.
Recovery command:
chkdsk E: /F /R
Letter "E" - disk number, subcommand "F" - error correction, subcommand "R" means recovery of bad sectors.
After the “chkdsk” command, the verification and correction procedure starts.
As a result, when the process is completed, you need to try formatting again.
Additional commands to help you format
If you need to format a flash drive while creating a disk label (name), you should use the command:
format F: /fs:NTFS /v:MyFlash
Where "MyFlash" - new, created label.
The result is as follows.
Also worth noting is the command Diskpart, which runs an application program that manages disk space.
The following commands operate within this utility:
- "List disk" - displaying the entire list of disks;
- "select disk 2" - in this case the number "2 » corresponds to the drive we selected;
- “attributes disk clear readonly” - starting the attribute cleaning process.
- "Clean" - starting the drive cleaning process;
- "Create partition primary" - creation of a primary partition.
- "format fs=NTFS" - quick formatting of the drive.
- "Exit" - exit the “diskpart” program.
If, despite the variety of commands using the command line, you are unable to format the flash drive, then you should turn to low-level formatting programs for help.