How to use diskpart to get disk information


In this short post we will use diskpart to get disk information on a Windows server.

Command Scenarios

So let’s cover a few scenarios using diskpart.

Open a command prompt and type diskpart to start using the command.

Using the list disk command we can get back the information on the disks available on the system for viewing and manipulation.

We see we have 2 disks on the server, so we will select disk 0 and view some information.

So let’s try a few commands. What partitions are there?


Now we can see the details of the volume using the FILESYSTEMS command.


To create a partition

At a command prompt, type: Diskpart

(Lists disks found. Make note of the drive number you wish to manipulate.)

Now lets create a 10 GB partition.

Or for a 10 GB partition with 64k allocation to improve disk I/O performance.

Note: Change the word PRIMARY to EXTENDED to create an extended partition.

Choose a drive letter not already being used.

All done, exit diskpart.

Use the Command Prompt format command, Disk Administrator or any disk format utility to format the drive.

To extend a partition

Extend a partition in Windows with Diskpart. When it comes to adding space to a partition or volume, this method is superior to configuring Dynamic Disks. Dynamic Disk extensions only concatenate the newly added space, meaning they merely add the disk space to the “end” of the original partition without re-striping the data.

Concatenation isolates performance within each partition and does not offer fault tolerance when the partition is configured in a RAID array. Diskpart allows you to re-stripe your existing data. This is truly beneficial when the partition is set up in a RAID array, because the existing partition data is spread out across all the drives in the array, rather than just adding new space to the end (like Disk Administrator).

Note: If you try it or any other method, make sure you have a full backup.

Verify that contiguous free space is available on the same drive and that free space is next to the partition you intend on extending (with no partitions in between).

C:\> diskpart
DISKPART> list disk
DISKPART> Select Disk 1 (Selects the disk.)
DISKPART> Select Volume 1 (Selects the volume.)
DISKPART> Extend Size=10000 (If you do not set a size, such as the above example for 10 GB, then all available space on the disk will be used.)

Delete a partition

To delete a partition in Windows with Diskpart: (Note: You cannot delete an active system or boot partition or a partition with an active page file.)

C:\> diskpart
DISKPART> Select Disk 1
DISKPART> Select Partition 1

To wiping (or zero) a disk

This operation deletes all data on the disk

C:\> diskpart
DISKPART> Select Disk 1
DISKPART> CLEAN ALL (The CLEAN ALL command removes all partition and volume information from the hard drive being focused on.)

Scan for new disks

Final notes:

Do not use DISKPART until you have fully backed up the hard disk you are manipulating
Do not use DISKPART on dynamic disks


As we can see there is a lot you can do with diskpart, much more than we have covered here in this post. If you are a command line kinda guy then diskpart is the tool for you. For more command line options look here.


2 Responses to “How to use diskpart to get disk information”

  1. Keesha says:

    TYVM you’ve solved all my prmboels

  2. Ângelo says:

    Thanks a lot for The information!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.