All About DiskPart Commands in Windows_____________________________________________ ______𝓜𝓭.𝓡𝓾𝓱𝓾𝓵 𝓐𝓶𝓲𝓷______
What is DiskPart?
DiskPart is a command-line utility that provides the ability to manage disks, partitions or volumes in your computer running all versions of the operating system since Windows 2000, also including the latest Versions of Windows 10/11. Users can input DiskPart commands directly to organize hard disk partitions or create a text file script to perform multiple commands.
How to open DiskPart in Windows 10/11?
The way is to type "cmd" in the Search box, and then when Command Prompt appears in the search results, right-click it and select "Run as administrator".
Then type "diskpart" and press the "Enter" key to apply it.
The other way is to press the "Windows logo + R" keys and type "diskpart" in the box, and then click "OK".
Common DiskPart Windows 10/11 Commands
Section 1. Most common Diskpart commands on volume in Windows 10/11
Because when selecting a volume, the focus remains on it until you select a different volume, the “select volume” command may not be used in each operation. Besides, the examples are performed one after one and the effect of the previous operation will be viewed in the next operation. If you only need to perform one of the operations, you need to select the volume before using the corresponding command.
➤ Note: Each time you type a command, you need to press the "Enter" key to apply it.
- Delete Volume
- Create a Partition
- Format Partition
- Assign Drive Letter
- Extend Partition
- Shrink Partition
- Mark Partition as Active
1. Delete Volume
To delete a volume, please refer to the following command:▪ list volume
▪ select volume 6 (here take F: drive for example).
▪ delete volume
And then, you will receive a message saying: DiskPart successfully deleted the volume.
Note: You cannot delete the system volume, boot volume, or any volume that contains the active paging file or crash dump.
2. Create a Partition
To create a partition, please refer to the following command:
▪ create partition primary size=102400
And then, you will receive a message that says: DiskPart succeeded in creating the specified partition.
And then, you will receive a message that says: DiskPart succeeded in creating the specified partition.
3. Format Partition
Type the list volume command, and you will find the newly created partition is RAW, which means you must format the partition before you can use it. To format a partition, please refer to the following command:
▪ format fs=ntfs label="Windows 7" quickAnd then, you will receive a message saying: DiskPart successfully formatted the volume.
The above command means to perform a quick format on the partition. It will be formatted with the NTFS file system and labeled as Windows 7. To create other file system partitions like FAT, FAT32, you just need to replace ntfs with fat or fat32. The label can be any name you like.
The above command means to perform a quick format on the partition. It will be formatted with the NTFS file system and labeled as Windows 7. To create other file system partitions like FAT, FAT32, you just need to replace ntfs with fat or fat32. The label can be any name you like.
4. Assign Drive Letter
A partition without a drive letter will be hidden under "File Explorer". To assign a drive letter to an existing partition, please refer to the following command:▪ assign letter=F (F can be replaced with another letter that has not been used yet).
And then, you will receive a message that says: DiskPart successfully assigned the drive letter or mount point.
5. Extend Partition
To extend a partition, please refer to the following command:extend size=20480
And then, you will receive a message saying: DiskPart successfully extended the volume.
The above command means to add 20480MB (20GB) to volume 6. If no size is given, all of the contiguous unallocated space on its right side will be added.
The above command means to add 20480MB (20GB) to volume 6. If no size is given, all of the contiguous unallocated space on its right side will be added.
6. Shrink Partition
To shrink a partition, please refer to the following command:
▪ shrink desired=10240
▪ shrink desired=10240
And then, you will receive a message that says: DiskPart successfully shrunk the volume by 10GB.
➧Note: You can reduce the size of a volume only if it is formatted using the NTFS file system.
7. Mark Partition as Active
To mark a partition as active, please refer to the following command:active
And then, you will receive a message that says: DiskPart marked the current partition as active.
Section 2. Most Common Commands on Disk in
Windows 10/11
▪ list disk
▪ select disk 1
▪ clean
▪ "convert gpt" or "convert mbr".
▪ select disk 1
▪ clean
▪ "convert gpt" or "convert mbr".














