Formatting a disk from the command line. "Format C": what is this command? Formatting hard drive partitions


Hello everyone Today we will talk about how to format a hard drive using the command line. And you know what I’ll tell you here? This information, well, I mean formatting a hard drive via the command line, then you definitely need to know this information! This information, so to speak, is included in the list of the most important information that a more or less advanced user should know.

My opinion is that everyone should be able to work with the command line. Well, not that everyone, but if suddenly your computer breaks down, then you need knowledge of how to use the command line, then this knowledge can be very, very useful to you, I’m telling you this honestly!

I think that you don’t need to say that formatting a disk will completely delete all the files on it, everything in general, and programs and all sorts of photos, music, everything will be deleted on the disk that you format! I hope that you understand this anyway, but I still had to write about it..

Okay guys, back to our topic, namely how to format a hard drive using the command line. This can be done both from Windows itself and when loading it, but the main thing is that all the actions are the same, you just need to clearly understand what’s what and that’s exactly what I’ll show you now. So look, if you do all this in Windows (but keep in mind that the system disk itself cannot be formatted, because it is Windows), then you need to hold down the Win + R buttons, the Run window will appear, there you write the cmd command and click OK :


Then a black window will appear, like this:


Well, I think that you already understand that this black window is the command line. Here you can enter all sorts of commands and do something. In general, you can do a lot of things. To see a list of all commands, you need to type the following command in the line:

And press enter, after which you will see this list of commands:


You can take any team, well, the very first one on the list is ASSOC, so let’s take it. Well, you can take any command, then add a space to it and something like /? and then press enter and there will be a mini-instruction for this particular command. Well, look, I wrote the following command:

I pressed enter and this is what I thought:


Well guys, in principle it’s more or less clear, right? That is, in this way you can somehow learn to use the command line yourself. But of course this is a little boring, but what can you do? Today I will show you how to format a disk using the command line, for this you need to use the following command:

Yes, you can look at the help on it, I have already shown how, but I think it would be better if I personally tell you about it, since I myself have used it more than once. And I didn’t just use it, there is one feature in this command, you may not be interested in it, but I’ll tell you about it anyway...

So what do you need to do to format a disk using the FORMAT command? You need to write the following command:

FORMAT C: /FS:NTFS /X

This is a standard command, it will format the disk as usual, so to speak. Where the letter C is, then you indicate the drive letter there. Such as /FS:NTFS is necessary for the disk to be formatted in the NTFS file system, it is also possible in FAT32, but I recommend NTFS. Such as /X is necessary so that the disk is forcibly disconnected before formatting, this is just necessary to ensure that everything goes correctly. Attention, guys! This command does the usual formatting, that is, it’s not so fast, but if you need everything to go quickly, then you need to add the /Q key, that is, so that it’s like this:

FORMAT C: /FS:NTFS /X /Q

It will be much faster and you won't have to wait. Because without the /Q switch, formatting can take a long time if the hard drive is not small... well, there is one terabyte or more...

That seems to be it, right? But I wrote about a trick, what kind of trick? Now I’ll tell you everything guys.. The trick is that there is also such a key /A:64KB, this key is so that when formatting the cluster is changed. A standard cluster is 4KB, that is, 4 kilobytes. What general cluster size can be can be found in the help for the FORMAT command. What is a cluster? I won’t burden you, I’ll just say that a cluster is the minimum unit that can be occupied on a disk.

So, regarding the cluster, look. A 4 kilobyte cluster is usually installed on a hard drive. That is, if you have a file of 100 kilobytes, then it will be written in small parts of 4 kilobytes. Windows does not always write the entire file to one area at once. Usually part of the file is in one place, and another part is in another, this is called fragmentation and this is a normal phenomenon. Do you understand? As a result, we get this: if the cluster costs 4 kilobytes, then the file can have many parts and they can easily be scattered throughout the hard drive, and in order to read the file, it takes more time than if the file was written in one piece. If the cluster is 64 kilobytes, then a 100 kilobyte file will have only two parts on the disk, these are 64 kb and 64 kb, because these parts will fit the entire file. What remains, well, I mean two clusters are 128 kb, and the file is 100 kb, then nothing at all can be written to the remaining 28 kb, this is the only disadvantage of a 64 kb cluster. It seems that there are no more disadvantages, well, at least I don’t see them. A 100 KB file will only have 2 parts on a 64 KB cluster versus 25 parts on a 4 KB cluster, get it? Once again, about the disadvantage that I wrote, in other words, a 100 kb file on a disk with a 64 kb cluster will take up 128 kb of space. Because two clusters are 128 kb. Well, I hope it’s more or less clear, but if not, then I’m sorry, it means I’m not explaining it well..

In general, I personally always install a 64 kb cluster, I like it better, my mother also has a computer and I also installed a 64 kb one for her and the computer seems to work faster. But if you think about it, in theory it should work faster. A 64 kb cluster is the best cure for fragmentation, but does not eliminate it completely..

So what should the command be so that the cluster is 64 kb? I personally use this one:

FORMAT C: /FS:NTFS /X /A:64KB

A cluster of 64 kilobytes is the maximum size for the NTFS file system. Well, you can also specify the /Q key to make formatting faster.

There is another joke. The fact is that there may be such a jamb that Windows does not want to be installed on a disk with a 64 KB cluster, there is such a thing. This is what I do here. At first I just stupidly install Windows, format the disk and everything is as usual. Then I reboot and go to system recovery and there I launch the command line, the system disk, well, that small, service disk of the type, it’s usually 500 MB, I DO NOT TOUCH it AT ALL. And the one where Windows is installed, then I put the FORMAT command on the command line and put a 64 kb cluster there and format it. Then I install Windows again, I don’t format ANYTHING in the installer, I just select the disk (which I formatted in a 64 KB cluster) and install it. As a result, Windows is easily installed on a disk with a 64 KB cluster

In fact, all this mess with clusters, I need it, but it’s not a necessity, almost all users have a 4 kb cluster and are happy with everything.. So you don’t have to worry about it, if you’re not interested in these clusters, then it’s not worth it change the cluster, that's it, my jokes so to speak.

Please note that in the command line, well, where the installer is, there is also a button Restore Windows or something like that, then there, in that command line, there the system drive can easily NOT HAVE THE LETTER C, but another, keep this in mind, because it is important! How to resolve the situation here? First you need to find out which letters belong to which sections. To do this you enter the following command:

And then write the following command:

And you will see what sections there are and what letters belong to them, look like mine:


Then, when you have looked, you need to enter this command:

This is to exit the DISKPART subsection, so to speak:


Another piece of information that will help you is the size of the disk; it is also easy to understand what kind of disk it is. There is also a command that will show you what is on the disk, this will also help you understand where which disk is, well, for example, to see what is on drive C, you need to write the following command:

And this is what the result will be:


What’s also good is that the disk size is also displayed here.

Here's another command:

This is to go to the directory, well, here above is just drive C as an example. Well, guys, everything seems to be more or less clear? I really hope so!

That seems to be all... And if something is wrong, then I'm sorry. By the way, it’s December, the 22nd, and therefore I congratulate you on the upcoming New Year 2017. I wish you happiness and that everything goes well with you.. By the way, the year of the rooster..

23.12.2016

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 the default formatting option, but may differ in others) can format disks and partitions in a variety of 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 full formatting (and not quick formatting, 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 desired 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 combination Shift + F10 or use the recovery console, then enter the original command in its original form (“format c:”) or select the proposed 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 only required if the user really needs such actions. Otherwise, you can use the standard string.

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.

As you know, the “format c:” command, originally related to MS-DOS tools, is used quite often for computer systems with Windows on board. Let many not be confused by the fact that support for MS-DOS by Microsoft was completed a very long time ago, since the system’s built-in tool in the form of a command console works exactly according to its principles, and some actions without the command line are impossible to perform at all, as well as to gain access to the hidden features of Windows. Next, we will consider the main aspects related to formatting and its practical application, without going too much into the technical components of additionally used attributes.

What is the "format c:" command?

As is already clear, the command itself is intended specifically for formatting the hard drive, but in this particular case we are talking purely about the system partition in which the operating system is installed (by default, Windows is installed on the “C” drive, unless another location is specified, for example , when installing a second OS on a virtual partition).

I would immediately like to draw the attention of all users to the fact that this toolkit can only be used on the command line. For the “format c:” command itself, it is possible to use some additional attributes that allow you to activate certain options, depending on what action needs to be performed when formatting a system or logical partition.

Areas of application of the command

First, let's determine when this command may be needed, and then move on to its practical use.

For the most part, disk formatting is required when installing an operating system or reinstalling it after critical failures or virus exposure, when restoring functionality using Windows or removing virus threats is impossible.

The command can also be used when partitioning a hard drive into additional partitions using diskpart tools (however, in this case, it is not the “C” drive that is formatted, but the created logical partition). Actions with the system partition are performed only in the situations described above. Sometimes such measures even help restore the performance of the hard drive.

Some nuances associated with starting formatting

Somewhat distracting from the description of the “format c:” command, I would like to cheer up the readers. There is such a good joke when the support service receives a phone call:

Word doesn't work for me, what should I do?

Do you have Word on your C drive?

Type: “format c:” and press Enter.

Will it help?

And how! The most effective remedy!

But this is, of course, a joke. The fact is that in a loaded (working) system, no matter how hard you try, it is impossible to format the disk (system partition). Windows simply won’t allow you to do this (well, the system won’t give permission to self-destruct?).

Thus, the question of how to do “format c:” comes down to initially booting from removable media, then calling the console and using the command in its environment. Sometimes, however, you can encounter non-standard situations.

For example, a user has two Windows systems of different modifications installed. One is located on the “C” drive, the second is installed on the “D” drive. Formatting the “C” partition can be done by booting into the environment of the second system and calling the command console in it.

The same can be observed in the case when some kind of virtual machine with the tested “operating system” is installed on the computer, which is a complete resemblance of a real computer, but in a virtual form.

View all command line attributes

But let's return to the main command "format c:". The Command Prompt allows you to perform many operations using this feature. In order not to describe absolutely all the attributes used, any user can be advised to review them themselves.

Just open the command line and enter the command “format /?” in it. After completing it, a complete list of additional attributes will appear on the screen with a detailed description of each of them.

Practical formatting

Now about the practical use of the “format c:” command. Windows systems will not allow you to do this, so we assume that the boot is done from removable media (installation or recovery disk or flash drive).

Entering the command in its standard form will completely format the specified partition. If you set the additional attribute “/Q”, this will lead to Quick format. The average user is unlikely to perform setting cluster sizes or other specific actions, so for now we can limit ourselves to this simple example.

Formatting when creating new partitions

Creating new partitions and bootable media looks much more interesting. True, the “format c:” command is not used in this case, as such, but familiarity with the general use of the format command may be useful to many users:

When using the "diskpart" toolkit, it is sometimes necessary to create a primary partition and then activate the boot partition. At one of the stages, formatting needs to be done (you can even manually specify the preferred file system), for which an additional “FS” operator is introduced, after which, for example, the NTFS system type is indicated. If such a pointer is not used, formatting will be performed while maintaining the current system.

The use of such tools sometimes allows you to quickly change the disk format from unreadable (RAW) to regular. This is much faster than trying to change it using the same operating system tools.

When using the general command, if the /U attribute was not initially specified, it is possible to undo the formatting by issuing the UNFORMAT command, since the old file distribution table along with the root directory are preserved. However, such actions mostly relate to processes associated with removable media and logical partitions.

Finally

That's all briefly about the formatting command. A description of each attribute used was not specifically considered here, since most users find them unnecessary in practical use, and are mainly required by system administrators or specialists involved in repairing computer equipment (in particular, hard drives).

But even the general knowledge presented above will help any user understand why the described command is needed, how and where it is used. However, situations are different, so you should not neglect using formatting via the command line, especially since the general command is used even when manually creating bootable media using the operating system, which eliminates the use of third-party software.-







2024 gtavrl.ru.