List of DISKPART Commands and How to Use them in Windows 10/11

By | December 22, 2021

The Windows Operating System is equipped with built-in Disk Management tools that offer a complete solution for managing hard disks on a computer. You can use it to shrink / decrease the volume, increase / increase the volume, create a new one and so on. The user interface is created using a series of DISKPART commands that work both in PowerShell and in the Command Prompt. This is especially useful when you need to run complex commands and work with virtual hard disks. The Diskpart utility has a list of commands you can use.

List of Diskpart Commands in Windows 10/11

active

Tag partition disc with focus as active

add

Reflect simple volume with focus to disc determined

assign

Set drive letter or
point mount to volume with focus

attach vdisk

Install (sometimes called mount or surface) virtual hard disk (VHD) so that appear in computer host as local hard disk drive

attributes

Showing or arrange or delete disk attributes or
volume

automount

Activate or deactivate
feature auto mount

break

Break mirrored volume with
focus Becomes two simple volume

clean

Delete a number of and all partition or formatting volume from disc with focus

compact vdisk

Reduce size
physical virtual hard disk (VHD) files that develop by dynamic

convert

Convert volume table allocation files (FAT) and FAT32 to
NTFS filesystem, let files and directory which there is permanent intact

create

Make partition
on disk, volume on one or
more disc, or virtual hard disk (VHD)

delete

Delete partition or volume

detach vdisk

Stop virtual hard disk (VHD) which chosen so that no appear as local hard disk drive in computer host

details

Showing information about disc, partition, volume or virtual hard disk (VHD) which chosen

exit

Go out from
interpreters (translator) order
diskpart

expand vdisk

Expand virtual hard disk (VHD) to
size which You define

extend

Expand volume or
partition with focus, together with files the system, to room empty
(unallocated) on disk

filesystems

Showing information about filesystem volume moment
this with focus and include file system that supported for
format volume

format

Format disc for
accept Windows files

gpt

Set GPT attributes to partition with focus on a GUID Partition Table (GPT) disk base

help

Showing list order
which available or information help detailed on order certain

import

Import group disk foreign to local computer group disk

inactive

Tag partition
system or partition boot with focus as no active on the disk master boot record (MBR) base

list

Showing disk list, partition in disk, volume in disc, or virtual hard disk (VHD)

merge vdisk

Merge virtual hard disk (VHD) which different with VHD parent which in accordance

offline

Switch disc or online volume to offline status

on line

Switch disc or
offline volume to online status

recover

Refreshing status all disc in disk groups, try restore disc in disk group no valid and synchronize
repeat mirrored volumes and RAID-5 volumes that have data that damaged

brake

Provide method for add comment to script

remove

Delete drive letter or point mount from volume

repair

Repair RAID-5 volumes with focus with replace disk region fail/damaged with dynamic disk determined

rescan

Find disc new which possible has added to computer

retain

Prepare dynamic simple volume there is for used
as boot or system volume

san

Showing or set
policy storage area network (san)
for system operation

select

Change focus to disc, partition, volume or virtual hard disk (VHD)

set id

Change field type partition for partition with focus

shrink

Reduce size
volume chosen with
amount which You define

uniqueid

Showing or set
GUID Partition Table (GPT) identifiers or Master Boot Record (MBR) signature for disc with focus

Tips: You can resize partitions even if Disk Management fails using the DISKPART and FSUTIL command line tools for Disk Management.

How to Use Diskpart

Diskpart runs in its own space, so when you run the command, you won’t be able to use the usual commands but only the Diskpart command.

  • Open Command Prompt or PowerShell with admin rights. For Command Prompt, search for it in the Start menu by typing cmd then right click to him and choose Run as Administrator. For PowerShell, press the key Win + X and select Windows PowerShell (Admin) or search in the Start menu for Windows 11.
  • Once open, type diskpart and press Enter. You will see a console to switch from the regular Windows path to Diskpart.

Some Basic Commands for Using Diskpart

You can start with a few basic commands to understand how they work, but be careful if you choose to delete anything. It cannot be recovered.

  • List Disk: Displays the number of connected hard drives or storage.
  • Select Disk : Selects a specific disk.
  • List Partition: Displays a list of partitions for the selected disk.
  • List Volume: Displays all partitions of all disks.

How to see list of Drives in Diskpart?

Once you are inside Diskpart, type Disk List and press Enter. This will list all connected storage, including hard drives, USB storage, SD cards or anything else connected to your PC.

How to wipe Volume or Partition?

Follow the steps below. Press Enter each time you enter the command below.

  • Select Volume
Then a confirmation message will appear that Diskpart has successfully deleted the volume. To format a usb or hard drive, you can read about it here or here.

How to Assign a Drive Letter to a Hidden Partition?

If a partition is visible in the Diskpart tool but is not available through File Explorer, then it’s because no drive letter has been assigned to it.

  • Select Volume
Make sure the specified letter/alphabet is not already in use. Meanwhile, to change the drive letter, you can read it here.

How to Reduce Partition Size?

Before we go any further, please know that this is a very long process. Until the process is complete, the drive will be almost useless.

  • Select Disk
  • Volume List
  • shrink desired=

It only works for NTFS file system.

How to wipe disk using Diskpart Clean command?

  • Open the Diskpart command in the Command Prompt.
  • Type disk list and press Enter.
  • Select the disk you want to clean using the command select disk .
  • Type clean and press Enter.

Make sure not to use the clean all command. That will delete all partitions from the selected disk. The process will take about an hour, depending on the size of the disk, as it will perform a safe wipe.

So many tutorials this time. Hopefully this is useful and helps you understand the DISKPART command and how to use it on your Windows 10 Windows 11. Don’t forget to leave your comments below to share your thoughts and experiences in following this tutorial. Thank you and GBU. UNITED AGAINST COVID-19!!

Category: