What is DiskPart?
DiskPart, replacing its predecessor - fdisk, is a command-line utility that provides the ability to manage disks, partitions or volumes in your computer running all versions of operating system since Windows 2000, also including the latest Windows 10. Users can input DiskPart commands directly to organize hard disk partitions, or create a text file script to perform multiple commands. Most commands that you can use in Disk Management tool are integrated in DiskPart.
How to Open DiskPart in Windows 10?
You will need to launch Windows 10 DiskPart with Administrator permission. One way is to type "diskpart" in the Search box, and then when diskpart appears in the search results, right-click it and select "Run as administrator". The other way is to press "Windows logo + R" keys and type "diskpart" in the box, and then click "OK".
DiskPart Windows 10 Commands and Examples
Before you can use DiskPart commands, you must first list, and then select an object to give it focus. When an object has focus, any DiskPart commands that you type will act on that object.
At the DISKPART> prompt, type "list disk" to display all the disks in your computer. Each one will have a disk number, starting with 0. An asterisk (*) under Gpt row means the disk is GPT partition style. Unless there is only one disk, you will have to tell DiskPart which disk to manage by using "select disk n" to give it focus. n represents the number of the disk.
At the DISKPART> prompt, type "list volume" to display all the volumes on all disks. Each one will have a volume number, starting with 0. To tell DiskPart which volume to manage, you need to type "select volume n" to give it focus. n can be the number of the volume or the drive letter of the volume if has.
To view what DiskPart can for you, just type help to see a list of commands.
In this article, we will take some of the most common commands that Diskpart uses for examples.
Most Common Commands on Volume in Windows 10
Because when select a volume, the focus remains on it until you select a different volume, so 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 corresponding command.
Note: Each time you type a command, you need to press "Enter" key to apply it.
- Type "list volume".
- Type "select volume 6" (here take F: drive for example).
- Type "delete volume".
To delete a volume, please refer to the following command:
And then, you will receive a message says: 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.
Type "create partition primary size=102400".
To create a partition, please refer to the following command:
And then, you will receive a message says: DiskPart succeeded in creating the specified partition.
The above command means to create a 102400MB (100GB) primary partition. To create other type of partition, you just need to replace primary with one of the followings:
Note: To create a partition, there must be unallocated space on the disk.
- Type "format fs=ntfs label="Windows 7" quick".
Type list volume command, you will find the new created partition is RAW, which means you must format partition before you can use it. To format a partition, please refer to the following command:
And then, you will receive a message says: DiskPart successfully formatted the volume.
The above command means to perform a quick format on the partition whcih will formatted with NTFS file system and labeled as Windows 7. To create other file system partition like FAT, FAT32, you just need to replace ntfs with fat or fat32. The label can be any name as you like.
Assign Drive Letter
- Type "assign letter=F" (F can be replaced with another letter that has not been used yet).
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:
And then, you will receive a message says: DiskPart successfully assigned the drive letter or mount point.
- Type "extend size=20480".
To extend a partition, please refer to the following command:
And then, you will receive a message says: DiskPart successfully extended the volume.
The above command means to add 20480MB (20GB) to the volume 6. If no size is given, all of the contiguous unallocated space on its right side will be added.
Note: To extend a partition, there must be contiguous unallocated space on its right side.
- Type "shrink desired=10240".
To shrink a partition, please refer to the following command:
And then, you will receive a message 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.
Mark Partition as Active
- Type "active".
To mark a partition as active, please refer to the following command:
And then, you will receive a message says: DiskPart marked the current partition as active.
Most Common Commands on Disk in Windows 10
Clean Disk/Convert Disk to GPT/ Convert Disk to MBR
- Type "list disk".
- Type "select disk 1".
- Type "clean".
Type "convert gpt" or "convert mbr".
To delete all partitions or volumes on a disk and convert the disk between MBR and GPT, please refer to the following command:
Free Alternative to Windows 10 DiskPart Utility
As DiskPart alternative, AOMEI Partition Assistant Standard is a free partition manager software and disk management tool, which provides more features than DiskPart. It not only supports Windows 10, but also supports Windows 8.1/8, Windows 7, Vista and XP.
It is very easy to use. To perform an operation on a partition, you just need to right-click on it. The operations supported by AOMEI Partition Assistant are as below:
The operations of disk management and step-by-step wizards are as below:
DiskPart in Windows 10 can meet the basic requirement of most users. However, AOMEI Partition Assistant Standard enables you to perform advanced operations on disk partitions in Windows 10 without data loss. You can download this freeware and have a try.