How to format hard disk or flash drive on the command line

Anonim

How to format a disk or flash drive on the command line
In some cases, you may need to format the USB flash drive or hard disk using the command line. For example, it can come in handy when Windows cannot complete formatting, as well as in some other situations.

In this manual, detail about several ways to format a USB flash drive or hard disk using the command line in Windows 10, 8 and Windows 7, as well as explanations about when which methods are for a greater extent.

Note: When formatting data from disk is deleted. If you need to format a C drive, do it in the running system will not work (since the OS is located on it), but methods, however, exists, as at the end of the instruction.

Using the Format command on the command prompt

Format - a command for formatting drives on the command line, existing since DOS times, but it is working and in Windows 10. With it, you can format the USB flash drive or hard disk, or rather - the section on them.

For a flash drive, it usually does not matter, provided that it is defined in the system and is visible to its letter (as they usually contain only one partition), for a hard disk may have: With this command, you can format only partitions separately. For example, if the disk is divided into sections C, D and E, using Format you can format first D, then - E, but do not combine them.

The procedure will be as follows:

  1. Run the command line on behalf of the administrator (see how to run the command line on behalf of the administrator) and enter the command (example is given to format a flash drive or hard disk partition with the letter D).
  2. Format D: / FS: FAT32 / Q (in the specified command after FS: You can specify NTFS to format not in FAT32, but in NTFS. Also, if you do not specify the parameter / Q, it will be not fast, and full formatting, cm . Fast or complete formatting of the flash drive and disk).
    Formatting flash drive on the command line
  3. If you see a message "Insert a new disk into drive D" (or with another letter), simply press ENTER.
  4. You will also be asked to enter the volume label (the name under which the disc will be displayed in the explorer), enter at your discretion.
  5. Upon completion of the process, you will receive a message that formatting is completed and the command line can be closed.

The procedure is simple, but somewhat limited: sometimes it is required not to simultaneize the disk, but also delete all sections on it (that is, combine them in one). Here Format is not suitable.

Formatting a flash drive or disk on the command line using diskpart

The DiskPart command line tool available in Windows 7, 8 and Windows 10 allows not only to format individual sections of a flash drive or disk, but also remove them or create new ones.

First, consider using DiskPart for easy section formatting:

  1. Run the command prompt on behalf of the administrator, enter DiskPart and press ENTER.
  2. In order, use the following commands by pressing ENTER after each.
  3. List Volume (here pay attention to the volume number corresponding to the letter of the disc to format, I have 8, you are in the following command to use your number).
    List Volume team in diskpart
  4. SELECT VOLUME 8.
  5. Format FS = FAT32 Quick (Instead of FAT32, you can specify NTFS, and if you are not quick, and complete formatting, do not specify Quick).
    Disk formatting in diskpart
  6. EXIT.

This formatting will be completed. If you need to remove all sections without exception (for example, D, E, F and the rest, including hidden) from the physical disk and format it as a single partition, you can do this in a similar way. In the command prompt, use commands:

  1. diskpart.
  2. List Disk (you will see a list of connected physical disks, you need a disk number that will be formatted, I have 5, you will have your own).
    List Disk team in diskpart
  3. SELECT DISK 5.
  4. Clean.
    Clean Disk Team in Diskpart
  5. CREATE PARTITION PRIMARY.
  6. Format FS = FAT32 Quick (instead of FAT32 it is possible to specify NTFS).
    Deleting partitions and formatting in diskpart
  7. EXIT.

As a result, one formatted main section with the file system you selected will remain on the disk. This can be useful, for example, when the flash drive is incorrectly due to the fact that there are several partitions on it (about it here: how to delete partitions on the flash drive).

Formatting on the command line - Video

At the end, about what to do if you need to format the C drive with the system. To do this, you will need to boot from the boot drive from the LiveCD (including with utilities to work with the hard disk partitions), Windows recovery disk or installation flash drive with Windows. Those. It is required that the system is not running, as it is removed when formatting it.

If you boot from the Windows 10, 8 or Windows 7 boot flash drive, you can click in the SHIFT + F10 key setting program (or SHIFT + FN + F10 on some laptops), it will cause a command line where the C disk formatting will be available. Also, the Windows Installation Program when selecting the "Full Setup" mode allows you to format the hard disk in the graphical interface.

Read more