Open In App

Diskpart Command in Windows

Improve
Improve
Like Article
Like
Save
Share
Report

DiskPart is a powerful tool for disk management under Windows OS. Diskpart Command is used to manage the computer hard drive, partitions, and volumes. This Command is not only limited to Windows 10 but also available in Windows 8.1,8,7 or even in Windows 2000. The Diskpart is used from creating or deleting partitions to wiping the drive clean or fixing errors on drives.

Diskpart looks similar to the Disk Management tool, but the only difference is that diskpart is a command prompt utility which makes it more powerful and provides more functionality than the Disk Management tool.

Let us see how Diskpart can help you to manage your drives, partitions, and volumes.

Note: You should always run your computer in Administrator mode while you are making use of DiskPart.

Syntax:

diskpart <parameter>

Parameters:

You can run the following commands from the Diskpart command interpreter:

ACTIVE      - Mark the selected partition as active.
ADD         - Add a mirror to a simple volume.
ASSIGN      - Assign a drive letter or mount point to the selected volume.
ATTRIBUTES  - Manipulate volume or disk attributes.
ATTACH      - Attaches a virtual disk file.
AUTOMOUNT   - Enable and disable automatic mounting of basic volumes.
BREAK       - Break a mirror set.
CLEAN       - Clear the configuration information, or all information, off the
             disk.
COMPACT     - Attempts to reduce the physical size of the file.
CONVERT     - Convert between different disk formats.
CREATE      - Create a volume, partition or virtual disk.
DELETE      - Delete an object.
DETAIL      - Provide details about an object.
DETACH      - Detaches a virtual disk file.
EXIT        - Exit DiskPart.
EXTEND      - Extend a volume.
EXPAND      - Expands the maximum size available on a virtual disk.
FILESYSTEMS - Display current and supported file systems on the volume.
FORMAT      - Format the volume or partition.
GPT         - Assign attributes to the selected GPT partition.
HELP        - Display a list of commands.
IMPORT      - Import a disk group.
INACTIVE    - Mark the selected partition as inactive.
LIST        - Display a list of objects.
MERGE       - Merges a child disk with its parents.
ONLINE      - Online an object that is currently marked as offline.
OFFLINE     - Offline an object that is currently marked as online.
RECOVER     - Refreshes the state of all disks in the selected pack.
             Attempts recovery on disks in the invalid pack, and
             resynchronizes mirrored volumes and RAID5 volumes
             that have stale plex or parity data.
REM         - Does nothing. This is used to comment scripts.
REMOVE      - Remove a drive letter or mount point assignment.
REPAIR      - Repair a RAID-5 volume with a failed member.
RESCAN      - Rescan the computer looking for disks and volumes.
RETAIN      - Place a retained partition under a simple volume.
SAN         - Display or set the SAN policy for the currently booted OS.
SELECT      - Shift the focus to an object.
SETID       - Change the partition type.
SHRINK      - Reduce the size of the selected volume.
UNIQUEID    - Displays or sets the GUID partition table (GPT) identifier or
             master boot record (MBR) signature of a disk.

Open and List Drives or Partitions or Volumes:

It is important to list the drives, partitions, or volumes before we go ahead and implement DiskPart commands on them. Follow the below-mentioned steps to list the drives:

  • Type diskpart, after pressing Windows+R Keys and clicking on ok.

  • In the DiskPart command Window, type list disk and hit Enter

  • This will list all the available drives with a number specified to them starting from 0.
  • If you want to see all the volumes then type list volume and hit Enter.

  • This will list all the available volumes with a number specified to it starting from 0.

The above article, explains the use cases and parameters of the diskpart command on Windows.


Last Updated : 30 Nov, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads