Use diskpart to manage your partitions
Search "A Description of the Diskpart Command-Line Utility" on MSDN"
You can find the E-version documentation. The official introduction is more detailed.
Diskpart is not the same as other commands. It is more like another shell. Diskpart can be used in two ways:
1 diskpart <ENTER>
2 diskpart/s <script_file>
The diskpart command is also written in diskpart/s <script>.
The following are some simple commands:
Let's talk about the help Command Format of several commands.
In diskpart mode, you can use help xxx to list the help of xxx commands. For example, the result of help list (a common command) is as follows:
OK. We know that list can display the object information in 4. So how to view one of these objects?
Help list disk
The output result of this command clearly tells you the list disk function and syntax. The following is an example.
Don't wait. Try this example. Its function is more NX than disk management in Windows.
Other commands also use help.
PS: as long as you can use it and be good at using help, some basic functions cannot help you at all. As some NB hacker tells us, "RTFD" (Read the fucking Document) or "RTFS" (Read the fucking source ).
1 list
List disk: display a list of disks
List volume: display a list of basic and dynamic volumes which are installed on the local machine. (can this item be executed remotely? God, I only know)
List partition: display a list of partitions in teh partition table for the selected disk (Oh, does this imply that I want to use sel disk before list par ?)
PS: the above volume and partition can be abbreviated as vol and par.
THE list command not only lists the names of each object, but also the size and free space. This information is sometimes useful.
2 select (sel)
Now, you have to operate these objects after list.
Of course, you have to select before the operation, or how do you know which object to operate.
This select statement is not used in SQL.
The select and list operations are similar. Only one more parameter is required, such as sel vol C. This command selects the Volume C object. Now let's take a look at the detailed information? All tell you the detailed information, D-E-T-A-I-L.
The help information of this command is also quite large. I checked it all by myself, and now I forgot about it when I remembered it. As long as you think of this command when operating the disk, OK (it is intended to remind you of it, cool !!)
3 clean(This command should not be used at will. It will definitely make you go bankrupt)
The general saying of this command is to clean the configuration information of your entire disk.
I tried to operate a USB flash drive and try to partition again. I tried a lot of commands but I couldn't. Later, I asked Mayo to learn about the power of clean. This command is "Easy to use". You don't have to select the object to operate. Just clean it and it will clear your MBR/GPT. It's really a waste of money.
(You can demonstrate this command to everyone !)
(Ah, isn't that a human life? How can I find a free disk)
PS: If you want to try this command, please make sure that it is backed up. You can also use a USB flash drive (sel disk N ).
4. shrink
Okay, this is the compressed volume managed by the disk.
To compress a volume, select a volume first.
How much free space is the volume to be compressed? There cannot be more free space.
What about the compressed space? How to use it?
The compressed space is behind this volume, and the compressed space is executed after this volume. To compress the data, you can cut the data from its tail.
After selecting the compressed volume
Shrink can certainly do this process to calculate the maximum size that can be compressed.
Wait for a while. The compressed size in the box that appears is the same as the result obtained by shrink (Amazing !!) (Weaver, diskpart is much more powerful than disk management)
E. Description: Reduce the size of the volume with focus by the specified amount. Makes free disk space available from unused space at the end of the volume. (You have been here for a long time, but you have not fully understood what the point is)
5 create
The create Command creates a new object (nonsense !!)
I used only one create par logical (primary) [size = xxxx]
Create a new partition from an UNUSED.
This size specifies the size of the new partition, in MB.
For other options, see the magic-cmd: help option.
6. delete
This product has been in conflict with create. Select an object before using del,
Sel vol F
Del vol
(Hey, what about my fdisk ?)
You have mastered these commands to complete basic disk operations. Of course it is better to write a script. Diskpart is also supported.
What? I forgot to tell you the most important command. How is it possible? How can I hide my private key?
Of course, this is not yours !! The most important command is H-E-L-P.