DiskPart

DiskPart command to manage Disks

DiskPart is a text-mode command to manage disk from command prompt, there are various action can be performed from command.

Syntax

Diskpart

SELECT Select an object (DISK, PARTITION, VOLUME, VDISK)
Example to select object number (0,1,2…)
Select Disk 0
Select Partition 0
Select Volume 0
Select Vdisk 0
LIST List an object (DISK, PARTITION, VOLUME, VDISK)
Example…
List Disk
List Partition
List Volume
List Vdisk
DETAIL Provide details about an object.
Example…
Detail Disk
Detail Partition
Detail Volume
Detail Vdisk
ACTIVE Selected partition will be marked as active.
ADD Add a mirror to a simple volume
ASSIGN Assign a drive letter.
ATTRIBUTES Display selected Disk or Volume attributes.
Example…
Attributes Disk
Attributes Volume
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 Volume
Example…
Create Volume Raid
Create Volume Simple
Create Volume Stripe
Create Volume Mirror
Create Partition EFI
Create Partition Extended
Create Partition Logical
Create Partition MSR
Create Partition Primary
Create Vdisk File=”filename”
DELETE  Delete 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.
IMPORT  Import a disk group.
INACTIVE  Mark the selected partition as inactive.
ONLINE  Online an object that is currently marked as offline.
OFFLINE  Offline an object that is currently marked as online.
REMOVE  Remove a drive letter or mount point assignment.
REPAIR  Repair a RAID
RESCAN  Rescan the computer looking for disks and volumes.
SAN  Display or set the SAN policy for the currently booted OS.
SHRINK  Reduce the size of the selected volume.