Home > Wiki Tips

Diskpart & Diskpart Command [Full Introduction]

Updated on Tuesday, December 3, 2024

Written by

Sherry Song

Approved by

Jessica Shee

English Français Deutsch やまと Español Português

Summary: What is Diskpart? How to use Diskpart? Diskpart is a command-line tool on Windows, which is designed for the administration of disks, partitions, and volumes. This post from iBoysoft will guide you walk through a brief introduction to Diskpart.

Diskpart, replacing the predecessor fdisk, is a powerful command-line utility in Windows that allows users to manage disk partitions effectively. Whether you need to format, create, resize, or delete partitions, Diskpart will provide a comprehensive set of commands for users to input to handle various disk-related tasks.

Basic functions of Diskpart:

  • Partition disks: Diskpart facilitates the creation, deletion, extension, and shrinking of partitions, offering users granular control over their storage space like fdisk commands.
  • Format disks and partitions: Diskpart ensures the proper formatting of disks and partitions, allowing users to choose file systems and optimize storage efficiency. 
  • Assign drive letters: Diskpart simplifies the process of assigning and modifying drive letters. 
  • Manage volume and file systems: Users can execute various disk-related operations with precision.

Today let's explore the Diskpart as much as we can, including the commonly seen Diskpart commands, how to open Diskpart on your computer, and how to use the Diskpart command.

How to open Diskpart?

The first step is to open Diskpart on your computer. Launching Diskpart is a straightforward process, here are three simple ways:

Open Diskpart using Command Prompt

  1. Press Windows and R to open the Run dialog. 
  2. Type cmd or cmd.exe and press Enter to open the Windows Command Prompt with admin rights.
     
  3. Type diskpart and press Enter in the Command Prompt window.

Open Diskpart with Windows PowerShell

  1. Press Windows and X then select Windows PowerShell or Windows PowerShell(Admin).
  2. Type diskpart and press Enter in the PowerShell window.

Open Diskpart with the Search box

  1. Type diskpart in the Search box. 
  2. Right-cilck Diskpart in the search results and select Run as administrator.

Open the Diskpart successfully? Share your ways with others.

 

Common Diskpart commands

After opening the Diskpart, you can select specific Diskpart commands to perform different disk operations. Some of the most commonly used commands include:

Diskpart CommandFunction
list disk/volume/partitionDisplay a list of available disks/volumes/partitions 
select disk XSelect the specified disk(replace X with the disk number) 
cleanRemove all partitions and volumes from a disk 
format fs=<filesystem>quickFormat a partition with the specific file system
create partition primary size=<size>Create a new primary partition with a specific size 
delete disk/partition/volumeDelete the selected disk/partition/volume
assignAssign a drive letter or mount point to the selected volume
activeMark the selected partition as active

How to use Diskpart?

If you may be confused about only knowing the common Diskpart commands but not knowing how to use them, just keep reading. Here are the main steps you can follow:

Step1: Open Diskpart
(Follow one of the methods mentioned above to open the Diskpart.)

Step2: List and Select Disk
(Type list disk to view all available disks then type select disk X to choose the disk you want to work with.)

Then you can perform your wanted Diskpart commands to begin:

Create a New Partition: Type create partition primary to create a new partition. 

Resize a Partition: Type list partition, and select partition X, then extend desired=SIZE.

Delete a Partition: Type list partition, select partition X, then delete the partition.

Example: Create a 600 MB primary partition with Diskpart

You can follow this simple example with the detailed steps or the photos below:

  1. Open Diskpart with the opening methods below.
  2. Type list disk then press Enter. (Select an available disk for the new partition creation.) 
  3. Type select disk2 and press Enter. (Select any permitted disk for the new partition creation.) 
  4. Type create partition primary size=600 and press Enter. 
  5. Enter the command exit and press Enter.

Tips for using Diskpart

After learning how to open and use the Diskpart commands, here are some tips that should be noted:

  1. Backing up data before using Diskpart: Backing up critical data in disk management operations will mitigate the risk of data loss.
  2. Verifying commands before execution: Users should thoroughly verify syntax and intended actions to prevent unintended consequences.
  3. Understanding the impact of Diskpart commands on data: Ensure you make informed decisions during disk management tasks.

Final words 

In conclusion, Diskpart is a versatile tool for managing disk partitions in Windows, offering users a command-line interface to perform various disk-related tasks efficiently. Understanding Diskpart commands and functionalities can empower users to control and organize space their storage space effectively.

Now do you know what the Diskpart is? Like this useful post, and share it with more people.