• How to format a disk from the command line. Diskpart program. Formatting and creating a bootable USB flash drive or disk via the command line. Practicing Formatting

    Modern hard drives (HDDs) are becoming more spacious and less expensive, and many people believe that it is better to buy one large drive - 2 - 3 - 4 terabytes - than several small ones. But not everyone realizes what difficulties they will encounter when installing an operating system on such a disk. The fact is that disks larger than 2 TiB use a non-standard, new type of data organization - the GPT partition table. It contains “surprises” that await the inexperienced user.

    The main differences between GPT (new) and MBR (old) disks

    • Disk partitioning according to the MBR standard cannot address space exceeding 2.2 TiB, and for GPT disks there are no restrictions (or rather, their limit is an astronomical number by our standards - 8.6 billion TiB).
    • Only 64-bit versions of Windows, starting with Windows Vista x64, can be installed on GPT disks. Windows XP 64-bit and all x86 versions since Vista can write to and read data from GPT partitions, but cannot boot from them. Windows XP x86 and higher versions do not support the GPT platform.
    • The GPT partition table is part of the UEFI interface - the new BIOS, so to speak. Computers with traditional BIOSes do not support the GPT structure.

    But this does not mean that modern, capacious GPT hard drives cannot be used the old fashioned way - on computers without UEFI or for installing 32-bit systems. You can: to do this, the GPT partition table just needs to be converted to MBR. Part of the volume - that which is beyond 2.2 TiB - will be inaccessible, but nothing can be done about it.

    Convert partition table from GPT to MBR

    Work with hard drive up to 2 TiB

    When installing Windows 7 x86 (32-bit) on a GPT disk, an error message appears clearly indicating the reason:

    If your hard drive is less than 2 TiB, a full format and deleting all partitions will solve the problem. This can be done through the “Disk Setup” option from the distribution package.

    • When, during the installation of Windows 7, you get to the selection of the partition where to install the system, and you see an error message, click the “Disk Setup” button.

    • Select each section, starting from the bottom, and delete by clicking the button of the same name. You should end up with one total unallocated space equal to the size of the entire hard drive.

    • Now you need to create each partition again. To do this, click the “Create” button, set the desired partition size and click “Apply”. Repeat the operation as many times as you want to obtain partitions. The system will ask you to allocate an area for its needs (boot partition 100 mb), it is advisable to agree.

    • Formatting of newly created partitions is done by clicking the “Format” button. After these steps, the GPT hard disk partition table will be converted to MBR, suitable for installing the 32-bit version of Windows 7. Further installation proceeds without any special features.

    Working with a hard drive larger than 2 TiB

    To create an MBR on disks of such large capacity, you will need a utility DiskPart, part of the seven distribution kit. It starts and works via the command line.

    • Having reached the choice of installation location, launch the command line by pressing “Shift” + “F10” on the keyboard. In the black window that opens, enter: diskpart and press Enter.
    • Next command: list disk– to view all hard drives installed on your computer.
    • Select the disk on which you will create the MBR. If he is alone, enter the command select disk 0, if there are several, instead of zero, substitute the serial number of the disk that you need.
    • Next, delete all data and all markings from the selected HDD with the command clean.
    • Team convert mbr converts GPT table to MBR.
    • To close the console, enter: exit.

    • Then you can proceed to installing Windows 7.

    Preparing a disk for installing Windows 7 using third-party programs: partitioning, formatting, etc.

    You can also partition and format the HDD before installing Windows 7 using third-party programs, such as “Acronis Disk Director”, “Paragon Partition Manager”, etc. There are enough applications for these purposes, but these two are familiar to many and are the best in in our class, so we will consider them.

    Acronis Disk Director

    Powerful disk management tool. Available in two versions - for working in the Windows environment and as a boot image. The second allows you to repartition, format, delete, move and restore volumes, and transfer data from partition to partition without booting into Windows.

    The principle of using Acronis Disk Director is intuitive - each of its options has a clear, unambiguous definition. Interface – English and Russian.

    In order to divide the HDD into partitions and format it in any of the proposed file systems (their list is quite extensive), select “Create partitions” and follow the wizard’s instructions.

    Acronis Disk Director has one very useful feature - the Partition Recovery Wizard. It allows you to restore deleted volumes to disk with all their data. Unless, of course, the information was overwritten.

    Paragon Partition Manager

    Another full-featured set of disk management tools. It is a boot image with which you can do a lot of things: split disks into volumes, format them in various file systems, create boot menus, create installation packages for OS distributions (not only Windows), manage system bootloaders, etc.

    As for partition management functions, Paragon Partition Manager allows you to create, delete, divide, copy, restore, merge, make backup copies and transfer them to external media. You can even transfer the entire contents of your hard drive to another. In addition to the above, the application has network functions that make it possible to create a connection with other computers on the local network.

    Despite the English-language interface, Partition Manager is quite easy to manage. Most options launch a built-in wizard that guides the user through all stages of the selected operation. It doesn’t take much time to master the program, and the result of what is done is always good.


    Managing partitions, formatting and other operations through the disk manager

    You can also redistribute disk space from under a running system through “Disk Management,” a native Windows 7 tool. The tool is located in the “Computer Management” set.

    • Launch Control Panel and open the Administrative Tools application. From the list of administrative tools, select “Computer Management”.

    • Next select “Disk Management”.

    • You will see a “map” of hard drives and other storage devices installed on the computer - flash drives, memory cards, etc., if they are connected.

    If the disks are divided into parts, each partition, otherwise called a volume, will be displayed on the map with its letter, size and type designation: primary or logical. At the top is a table of the properties of each volume. Here you can see which of them your system boots from - the boot partition has the “Active” attribute.

    The active partition in Windows 7 is a 100 MB partition at the very beginning of the hard drive (MBR standard). It does not have a letter and does not appear in Explorer.

    Right-clicking on one of the partitions on the disk map opens a list of available commands: what operations can be performed on this volume.

    So, on logical partition D of our only hard drive, you can do the following:

    • open (via explorer);
    • change letter;
    • change the disk path;
    • format;
    • expand;
    • squeeze; squeeze
    • delete;
    • view properties;
    • read the help.

    If you remove the volume letter, it will not appear in Windows Explorer, like other hidden partitions. Such as SYSTEM - where the Windows 7 bootloader is located, and the RECOVERY partition. This protects the files stored there from accidental damage and deletion.

    The “format” command will destroy all information, the “expand” and “shrink” commands are intended to control the size of the partition. “Delete”, accordingly, will turn the selected area of ​​​​the hard drive into unallocated space.

    In short, working with the disk manager is not difficult, but it requires attention and caution from the user.

    Team FORMAT Allows you to format a disk/floppy disk in the Windows command line.

    Command line format:

    FORMAT volume

    FORMAT volume

    FORMAT volume

    FORMAT volume

    FORMAT volume

    Command line options:

    volume- Specifies the drive letter (followed by a colon), mount point, or volume name.

    /FS:filesystem- Indicates the file system type (FAT, FAT32, NTFS, or UDF).

    /V:label- Volume label.

    /Q- Quick formatting. Overrides the /P option.

    /C- NTFS only: Sets the default compression mode for all files created on the new volume.

    /X- Initiates dismounting of the volume as a first action, if necessary. All open handles to the volume will be invalid.

    /R:edition- UDF only: Formatting in the specified UDF version (1.00, 1.02, 1.50, 2.00, 2.01, 2.50). The default version is 2.01.

    /D- UDF 2.50 only: Metadata will be duplicated.

    /A:size- Replaces the default cluster size. In general, it is recommended to use the default cluster sizes.

    NTFS supports sizes 512, 1024, 2048, 4096, 8192, 16 KB, 32 KB, 64K.
    FAT supports sizes 512, 1024, 2048, 4096, 8192, 16 KB, 32 KB, 64 KB, (128 KB, 256 KB for sector size > 512 bytes).
    FAT32 supports sizes 512, 1024, 2048, 4096, 8192, 16 KB, 32 KB, 64 KB, (128 KB, 256 KB for sector size > 512 bytes).
    exFAT supports sizes 512, 1024, 2048, 4096, 8192, 16 KB, 32 KB, 64 KB, 128 KB, 256 KB, 512 KB, 1 MB, 2 MB, 4 MB, 8 MB, 16 MB, 32 MB.
    The FAT and FAT32 file systems impose the following restrictions on the number of clusters on a volume:

    FAT: number of FAT32 clusters: 65,526 The FORMAT command will abort immediately if a violation of the above restrictions is detected using the specified cluster size.

    NTFS compression is not supported for clusters larger than 4096.

    /F:size- Indicates the size of the floppy disks being formatted (1.44)

    /T:tracks- The number of tracks on each side of the disc.

    /N:sectors- Number of sectors on each track.

    /P:times- Resets each sector of the volume to zero the specified number of times. This option has no effect with the /Q option

    /S:state- Where "state" can take the values ​​"enable" or "disable". Short names are enabled by default

    Examples of using the command FORMAT:

    format/?- display help on using the command

    format/? | more- display help on using the command with page-by-page display mode.

    format/? > C:\formathelp.txt- display help on using the command with output to the text file C:\formathelp.txt

    format A:- format the floppy disk in drive A: with default settings.

    During command execution format messages displayed:

    Insert the new disk into drive A:
    and press ENTER...
    File system type: FAT.
    Check: 1.44 MB

    The floppy disk will be formatted using the file system type FAT and volume 1.44 MB

    If there are open files on the disk to be formatted, then the command format will issue a warning:

    The Format command cannot be run because The volume is in use by another process.
    You can run Format if you unmount the volume first.
    ALL OPEN VOLUME DESCRIPTORS WILL CONTINUE TO BE INCORRECT.
    Do you confirm that the volume is disabled?
    The user has the option to cancel the formatting or continue it by entering Y. After confirming the request, all files will be forcibly closed and the volume will be disconnected. This operation cannot be performed on the system drive.

    Volume is disabled. ALL OPEN VOLUME DESCRIPTORS HAVE BEEN INCORRECT.
    After formatting starts, information about its progress, a request for a volume label and the results are displayed:

    The File Allocation Table (FAT) is initialized...
    Volume label (11 characters, ENTER - no label needed):
    Formatting is complete.

    1,457,664 bytes total on disk.
    1,457,664 bytes available on disk.

    512 bytes in each cluster.
    2,847 clusters on disk.

    12 bits in each FAT entry.

    Volume serial number: 3281-2839

    FORMAT A: /T:80 /N:9- format a floppy disk to the FAT file system using geometry 80 tracks and 9 sectors per track (720kb floppy disk).

    FORMAT F: /FS:NTFS- format a removable disk (flash drive) into the NTFS file system. Please note that the NTFS file system is not supported on devices optimized for fast deletion. Therefore, in order to format a regular flash drive in NTFS, you need to change the optimization method, for which in Windows Device Manager open the properties of the removable drive and go to the "Policies" tab

    After setting the policy Optimize for execution formatting a flash drive partition into the NTFS file system will be possible:

    Insert the new disk into drive F:
    and press ENTER...
    File system type: FAT32.
    New file system: NTFS.

    format L: /fs:UDF /V:UDFTOM /Q- format the optical disk into the UDF (Universal Disk Format) file system. Label of the volume being formatted - UDFTOM. Quick formatting (/Q) is used, i.e. creating a table of contents without checking blocks. If the rewritable optical disk contains data, the program will ask for the label of the existing volume:

    Enter the volume label for drive L: Disk19- label of the existing volume.

    If the disk is not empty and the current volume format does not allow quick formatting, then the utility format will display the message:

    The current format is invalid.
    Quick formatting of the disk is not possible.
    Start unconditional formatting?

    After answer Y formatting will continue:

    Performing formatting at a lower level...
    Creating file system structures.
    Formatting is complete.
    4.38 GB total on disk.
    Available: 4.38 GB.

    Once formatting is complete, a rewritable optical disk with the UDF file system can be used in both Explorer and the Windows command line to create, edit, and delete files and directories, just like a large-capacity floppy disk or flash drive.

    One of the most common actions with hard drives of any type is formatting them. There can be quite a lot of situations when a logical partition or hard drive requires formatting. But in some cases, in particular with regard to the system partition, the standard procedure cannot be performed using Windows. In this case, the command line is used (we take Windows 10 as an example), which can be launched by booting from removable media. Next, we will consider several options for carrying out the formatting process both in the operating system environment and when booting from an optical disk or a regular flash drive.

    Formatting a hard drive via the command line: why is it needed?

    First of all, it is worth saying that absolutely all experts note the fact that formatting is best done from the command console, despite the fact that the system itself has its own tool.

    Firstly, additional attributes can be applied to the basic formatting commands, which, in addition to carrying out the process itself, allow you to perform some additional actions. Secondly, the console becomes absolutely indispensable when reinstalling the operating system, troubleshooting problems, or when the hard drive does not open, for example due to damage, and loading the OS becomes impossible. If critical failures occur on your hard drive, whether you like it or not, you cannot do without a full format. Some users try to use quick formatting, however, as practice shows, it can only clear the table of contents and, in the end, when you need to bring the hard drive back to life, it turns out to be far from the best tool, unlike full formatting.

    How do you open the Windows 10 Command Prompt?

    First, let's look at calling the console itself. Any Windows system has several simple methods.

    The most used and most common method specifically for Windows 10 is to use a special “Run” menu, in which you enter In systems of a lower rank, this option can also be used, but previously the link to the console was displayed directly in the main menu, called through the “Start” button , but in the tenth modification this is not the case.

    An equally simple way is to enter a query in the search field, which can be called up from the right-click menu on the Start button. Here you can simply launch the console, or you can start it via RMB as an administrator (working with the command line very often requires administrative rights, especially to carry out any critical actions in relation to the hard drive and the operating system itself as a whole).

    Finally, you can open the System32 directory in the standard Explorer, located in the main system directory, and launch the cmd.exe file using the methods that were shown just above (opening the file as administrator).

    When booting from removable media (installation, recovery disks or USB drives), in most cases the combination Shift + F10 is used.

    Some nuances of disk access

    I would immediately like to draw the attention of all users to the fact that even when using the cmd.exe applet, formatting the system partition will not work. This is understandable. Well, the system cannot format the disk on which it is located.

    Therefore, formatting a hard drive via the Windows command line in the operating system itself applies exclusively to logical partitions, removable media (including USB HDD), as well as to other hard drives installed on the computer (RIAD arrays). By the way, even if the operating system is installed not on drive C, but, for example, on partition D, formatting the first partition will still be unavailable, since when booting the primary BIOS system accesses this partition, and in any case it contains the files necessary to start the OS.

    Standard logical partition formatting

    Now directly about the process itself. For now, we will not touch the system partition, but will focus on logical and additionally installed disks of any type.

    After calling the console, in the simplest case, formatting the hard drive through the command line is done using the universal format command, after which the drive or partition letter is entered separated by a space with a colon. For example, the disk in the system is designated by the letter H. The command in this case will look like “format h:”.

    This is a complete formatting of the hard drive via the command line, although you can use another method, which will be described in more detail below.

    Additional format command attributes

    As already mentioned, the good thing about this command is that you can add additional attributes to it, as a result of which some other actions can be performed.

    You can view a complete description of all possible options for executing a command in the console itself by entering the line format /? (this command opens the full list of additions). There are quite a lot of attributes, but among all of them it is especially worth noting quick formatting by entering /q after the main command, formatting with installation of a specific file system, for example fs:ntfs, as well as the use of the V:NAME combination to set the volume label, where NAME is an arbitrary disk name or section.

    Booting from removable media and calling the command line

    In situations where there are problems accessing the system partition, in particular the hard drive cannot be opened, you can format it (if other troubleshooting methods do not help) only from the command console launched when booting from removable media. One of the most popular tools is starting from a LiveCD.

    Formatting a hard drive through the command line, which can be accessed with the combination Shift + F10 (from the recovery console or without it), can be done using the same format command, indicating the letter of the system partition and specifying additional formatting parameters.

    Using the diskpart tool

    However, as most experts admit, it is not always appropriate to use a standard command. Another method is considered more effective, however, in most cases it is usually used for removable USB devices, including USB hard drives, from which you need to make a boot device.

    In this case, formatting a hard drive via the command line (diskpart) begins by entering the command of the same name, after which the list disk combination is entered to view all drives installed in the system.

    All disks are marked not with letters, but with numbers. Therefore, some users are faced with the problem of identifying their device. The easiest way to recognize it is by the indicated size (you obviously can’t confuse the same flash drive with a hard drive).

    Next, to select a disk, use the select disk X command, where X is the number of the desired disk from the list presented. After this, the clean line clears the contents of the media, and then creates a primary partition (the create partition primary command). After this, the current partition is selected again (select partition 1) and activated (active). This command is not always used. If you do not plan to make it bootable, you can skip it.

    Only at this stage does the actual formatting of the active primary partition begin, indicating the preferred file system, for which the format fs=ntfs (or fat32) command is used. If you need to do quick formatting, quick is added to the line separated by a space. But to achieve optimal results, you should not use it.

    At the end of the process, the partition (device) needs to be assigned a volume label. This is done with the assign command (the letter will be assigned to the device automatically). After this, all that remains is to transfer the installation distribution files to the created drive.

    Third party utilities

    If someone does not like such methods, any free one like Disk Director from Acronis, HDD Low Level Format Tool, Partition Magic, Paragon Hard Disk Manager, etc. can be used to simplify the work.

    True, they are all equipped with a graphical interface, and we are not talking about using the command console, although many users will find it much easier to work with such utilities. But, since in this case it is the use of the command line that is being considered, there is no point in dwelling on such utilities and their capabilities.

    Conclusion

    As a result, it remains to be said that using the console, in which commands specially provided for in Windows systems are entered, which, by the way, migrated to these operating systems from DOS, is not particularly difficult. In addition, it is the command line that allows you to eliminate a great many problems that cannot always be fixed using Windows tools and system tools. And the formatting process itself is head and shoulders above what it would be if it were run in an operating system environment. It’s no secret that quite often you can see a message appear that Windows, for some reason, cannot complete the formatting. And if you work with a console, such problems almost never arise. And that is why, in most cases, it is recommended to carry out all processes related to cleaning, formatting disks and partitions, preparing bootable media, etc. exclusively using standard console commands, and not other built-in system tools.

    Almost all users of Windows systems have heard about the presence in operating systems of such a tool as the “format c:” command to format a disk or partition. But not every user imagines the areas of use of this tool, as well as the elimination of some problems that may arise at the formatting stage.

    Windows 7 “format c:” command: what is it for?

    Yes, indeed, this toolkit is used specifically for formatting a hard drive or logical partition. But it works according to slightly different principles that are used in the operating systems themselves.

    The "format c:" command (in Windows "format c:" is used for formatting by default, but in others it may differ) can format disks and partitions in different ways. For example, for removable media, quick formatting is most often used, for system disks - full formatting, sometimes it is necessary to create boot areas, etc.

    The built-in tool, which can be accessed through the properties of the selected disk or removable media, does not always work. File system corruption can have consequences, especially if a fast process is used. In addition, in a loaded and currently running operating system, it is impossible to format the system disk (the operating system itself is installed on it, and quite naturally, it does not allow itself to be deleted). We’ll return to these questions a little later, but for now let’s look at exactly when it may be necessary to use the “format c:” command (in Windows, “format c:”, as is already clear, can be used exclusively in a selective way and not for all media).

    When is formatting required?

    As for the scope of application of this command, first it is worth noting that it is in this form that it can be entered exclusively on the command line (using additional attributes). Although the built-in GUI tool appears to be exactly the same as this service, it is not.

    For example, many users are installing the system, so to speak, from scratch. To ensure that an installed OS of the same version on top of an existing, earlier or later modification does not inherit system errors from the previous system, the system partition must be subjected to a full format (and not a quick format, which only involves clearing the table of contents).

    At the installation stage, the installer will offer options for action. But quite often you can encounter situations when a message appears on the user’s computer stating that such actions are impossible, since the selected partition belongs to GPT, and not to MBR. This problem can be resolved quite simply, but using the diskpart toolkit followed by formatting.

    Tool “format c:”: how to format a partition in the system?

    First, let's look at the simplest option. Let's say a user's hard drive is divided into two partitions (C and D). The first is systemic, the second is logical. The system will not allow you to perform actions with the “C” drive, but for the second partition you can use the disk properties call through the RMB menu through the same “Explorer” and set the formatting. The same, by the way, applies to any kind of removable storage devices.

    Don't like this way? Call the command line and write the required command in it, specifying the required letter for the corresponding section.

    Note: the “format c:” command, applied specifically to the system partition, only works if a second OS is installed on a virtual partition and only if it is currently loading. This is explained simply: for example, the XP version is installed on drive “C”, and Windows 7 is installed on drive “D”, which is currently loaded. It will not be difficult to format the first disk, but the system previously installed on it will simply be destroyed.

    Formatting the system disk

    Now a few words about using the “format c:” command in Windows 7, if only one operating system is installed on the computer. In this case, you cannot do without starting from removable media. There are simply no other options.

    Boot from a disk or flash drive, call the command console using the Shift + F10 combination or use the recovery console, then enter the original command in its original form (“format c:”) or select the suggested tool. You can, of course, add additional attributes indicating changing the file system or performing a quick format, but if we are talking about completely clearing the contents, it is better not to use such solutions. The same applies to the formatting process if viruses that cannot be removed by any means have become embedded in the system partition.

    Problems with command execution

    Finally, execution of the "format c:" command may be blocked. In the case of installing two or more systems, this may only concern the fact that the command console itself is launched without the appropriate administrator rights.

    When starting from a removable device, failures most often occur due to their damage (scratches on disks, file system errors on USB drives, etc.). Thus, before writing the installation distribution or recovery configuration onto removable media of any type, you just need to check it visually or systemically).

    Instead of a total

    Of course, this is not all that can be said about the “format c:” command. If there is such a need, additional attributes that can be used as a supplement to the main tool can be viewed in the same command line by specifying “format /?” as the executable command, then select the combination that is suitable for use in this situation .

    But this is required only if the user really needs such actions. Otherwise, you can use the standard string.

    The other day I tried to connect my old WD external hard drive (which had been lying around for a long time) to a Windows 8.1 computer and found that they couldn't access it. As soon as I connected it and opened the “This PC” folder, I saw a green bar slowly filling the address bar of the window, and when I right-clicked on the icon for this drive, the system briefly froze. Then I realized that there was something wrong with the disk, and in order to try to “revive” it, I needed to check it for errors and format it if necessary.

    External hard drive not available

    If you encounter a situation where your external hard drive has become inaccessible, this guide will help you check for errors/format it using the Command Prompt (CMD).

    How to check disk using CMD

    Using the WinX menu in Windows 8 (8.1), open a Command Prompt window and enter the following command:

    Where "D" is the letter of the external hard drive - or any other drive for that matter - that needs to be scanned for errors and then corrected if any are found. In short, you just need to replace "D" with your drive letter and then press the Enter key on your keyboard.

    This will start the process of checking the disk and correcting any errors that are found.

    Advice: The command line can also be launched using the Run dialog. To do this, press Win + R on your keyboard, enter the command “cmd” (without quotes, of course) and press Enter.

    In my case, it was the check that helped - as soon as the process was completed, I discovered that I again had access to the disk.

    How to format a drive using CMD

    There is nothing complicated here either. To format a drive using the command line, type the following command and press Enter:

    Again, replace “D” with the letter of the drive you want to format.

    I hope this information will help you someday. Good luck!

    Have a great day!