Managing Disks Using Diskpart Utility with Examples

As discussed in the previous posts, disk management tasks can be performed using the various tools such as Disk Management console, Windows PowerShell, and DISKPART. DISKPART is a command-line utility that allows you to create, format, and delete disk volumes and partitions on a Windows system. In this post, we will explain how to manage disks using DISKPART command line utility.

Also read:

There are various sub-commands of the DISKPART utility that can be used to manage disks and partitions on a Windows system. Let’s understand each of them one by one. We have used figures to show you each of the syntaxes with the examples. Please have a quick look at each of the following figures to understand the DISKPART utility. First, move on to DISKPART command mode and execute the DISKPART sub-commands with the admin privileged.

Viewing Disk Details Using DISKPART

  1. To list the all available disks on a Windows system use the following command.
    DISKPART>list disk
  2. To select a disk, use the following command.
    DISKPART>select disk <disk number>

    manage disk using diskpart utility

  3. Once a disk is selected, you can create, format, and delete partitions for the selected disk.
  4. To view the details of selected disk, execute the following command.
    DISKPART>detail disk

    select disk using diskpart utility

Creating a New Partition Using DISKPART

  1. To create a primary partition on the selected disk using the diskpart utility, execute the following command.
    DISKPART>create partition primary size=<size in MB>

    create primary partition using diskpart

  2. To list all the partitions on the selected disk, execute the following command.
    DISKPART>list partition
  3. To select a disk partition, execute the following command.
    DISKPART>select partition <partition number>

Assigning Drive Letter Using DISKPART

  • To assign a drive letter for the created partition, execute the following command.
    DISKPART>assign letter=<letter>

    select partition

Formatting Partitions Using DISKPART

  • To format a selected partition, execute the following command.
    DISKPART>format fs=<filesystemtype> quick label=<label>

    format partition using diskpart utility in Windows

Shrinking and Extending Partitions Using DISKAPRT

  • To shrink a selected partition, execute the following command:
    DISKPART>shrink desired=<size in MB> minimum=<size in MB>
  • To extend a selected partition, execute the following command.
    DISKPART>extend size=<size in MB>

    extend a partition using diskpart

In this post, we have discussed how to manage disks in Windows using the DISKPART utility. We have explained each command syntax with the appropriate examples, so you can easily understand the usage of the DISKPART utility. Please drop your queries in the comment box.

Posted in Windows 10, Windows Server 2016 Tagged with: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*