logo
Windows 10 Create or Delete Partitions Using Command Prompt

How to Create or Delete Partitions Using Command Prompt

By Achilles Hill | Last Updated

An account with administrator privileges can use DiskPart Command to complete many functions related to computers' drives, including but not limited to create, format, delete, shrink disk partitions. In this Windows 10 guide, we will walk you through the steps to create or delete partitions using the command prompt. Let's begin.

Part 1: Create new partitions using command prompt

Step 1: Type "cmd" or "command prompt" in the search box in the lower-left corner. Right-click the icon and select Run as administrator.

Step 2: Type diskpart on the command prompt and press Enter.

Step 3: Type list disk and hit Enter to show all available disks. You can see the sizes of the free space on all disks. It is recommended to select a disk with a large free space to create a new partition.

list disk

Step 4: Input "select disk disk-number" to choose a disk. Make sure to replace the disk-number with the disk you'd like to choose. For instance, type "select disk 0" and press Enter.

Step 5: Type the following command to create a new partition with 10000MB size:

create partition primary size=10000

Of course, you can allocate more space to the partition as long as it does not exceed the size of space left on the selected disk.

create partition

Step 6: (optional). If you want to format it using the NTFS file system and give it a name, type format fs=ntfs quick label=data and press enter. Want to learn more about formatting partition using cmd? Read this article for more information: How to Format Disk Partition Using Command Prompt.

Step 7: Type Exit and press enter to close the command prompt.

Part 2: Delete a partition using DiskPart

You can delete almost any partition, except for the system partition which running CMD. Remember to back up important data before partition formatting. There are 2 ways to remove a partition using CMD.

Way 1. Delete partitions with volume command

Step 1: Run CMD as administrator.

Click the "Start" menu and type cmd in the searching box. Then right-click the top result and select the Run as administrator.

Step 2: Run volume command.

In the pop-up interface, type diskpart and press Enter. Then input list volume and hit Enter.

run volume command

Step 3: Select and delete a volume.

Type "select volume volume-number" to select the volume you'd like to delete and hit Enter. Remember to replace volume-number with the partition you want to delete, like "Select volume 4".

Then type delete volume and press Enter.

select and delete a volume

Step 4: Type exit and hit Enter to leave DiskPart and close command prompt.

exit cmd

Way 2. Remove a partition with partition command

Step 1: Run CMD as administrator.

Click the "Start" menu and type cmd in the searching box. Then right-click the top result and select the Run as administrator.

Step 2: Select a disk.

In the command prompt window, input diskpart and press Enter. Then type list disk and hit Enter. According to the disk information, choose the one where the partition is located, type "select disk disk-number" and press Enter.

select a disk

Step 3: Select the partition.

Type list partition and hit Enter.

Find the partition according to the information presented. Type "select partition partition-number" and press Enter.

select the partition

Step 4: Delete the partition. After the partition is selected, type delete partition and hit Enter.

Step 5: Type exit and hit Enter to leave DiskPart and close command prompt.

exit command prompt

Related Articles: