diskpart
The diskpart command interpreter helps you manage your computer's drives (disks, partitions, volumes, or virtual hard disks). Windows commands reference
On Windows File diskpart.exe
Windows
The diskpart command interpreter helps you manage your computer's drives (disks, partitions, volumes, or virtual hard disks). Before you can use diskpart commands, you must first list, and then select an object to give it focus. After an object has focus, any diskpart commands that you type will act on that object.
diskpart <parameter>
To see available disk(s), run list disk
list diskIdentifyTo select a disk, run select disk followed by the disk number. For example
select disk 1IdentifyBefore disk 1 can be utilized, a partition will need to be created by running create partition primary
create partition primaryIdentifyLastly, we can perform a quick format of disk 1 to NTFS with the label "Backup" by running format fs=ntfs label=Backup quick as seen below
format fs=ntfs label=Backup quickIdentifyShow 38 options
activeMarks the disk's partition with focus, as active.addMirrors the simple volume with focus to the specified disk.assignAssigns a drive letter or mount point to the volume with focus.attach vdiskAttaches (sometimes called mounts or surfaces) a virtual hard disk (VHD) so that it appears on the host computer as a local hard disk drive.attributesDisplays, sets, or clears the attributes of a disk or volume.automountEnables or disables the automount feature.breakBreaks the mirrored volume with focus into two simple volumes.cleanRemoves any and all partition or volume formatting from the disk with focus.compact vdiskReduces the physical size of a dynamically expanding virtual hard disk (VHD) file.convertConverts file allocation table (FAT) and FAT32 volumes to the NTFS file system, leaving existing files and directories intact.createCreates a partition on a disk, a volume on one or more disks, or a virtual hard disk (VHD).deleteDeletes a partition or a volume.detach vdiskStops the selected virtual hard disk (VHD) from appearing as a local hard disk drive on the host computer.detailDisplays information about the selected disk, partition, volume, or virtual hard disk (VHD).exitExits the diskpart command interpreter.expand vdiskExpands a virtual hard disk (VHD) to the size that you specify.extendExtends the volume or partition with focus, along with its file system, into free (unallocated) space on a disk.filesystemsDisplays information about the current file system of the volume with focus and lists the file systems that are supported for formatting the volume.formatFormats a disk to accept files.gptAssigns the gpt attribute(s) to the partition with focus on basic GUID partition table (gpt) disks.helpDisplays a list of the available commands or detailed help information on a specified command.importImports a foreign disk group into the disk group of the local computer.inactiveMarks the system partition or boot partition with focus as inactive on basic master boot record (MBR) disks.listDisplays a list of disks, of partitions in a disk, of volumes in a disk, or of virtual hard disks (VHDs).merge vdiskMerges a differencing virtual hard disk (VHD) with its corresponding parent VHD.offlineTakes an online disk or volume to the offline state.onlineTakes an offline disk or volume to the online state.recoverRefreshes the state of all disks in a disk group, attempt to recover disks in an invalid disk group, and resynchronizes mirrored volumes and RAID-5 volumes that have stale data.remProvides a way to add comments to a script.removeRemoves a drive letter or mount point from a volume.repairRepairs the RAID-5 volume with focus by replacing the failed disk region with the specified dynamic disk.rescanLocates new disks that may have been added to the computer.retainPrepares an existing dynamic simple volume to be used as a boot or system volume.sanDisplays or sets the storage area network (san) policy for the operating system.selectShifts the focus to a disk, partition, volume, or virtual hard disk (VHD).set idChanges the partition type field for the partition with focus.shrinkReduces the size of the selected volume by the amount you specify.uniqueidDisplays or sets the GUID partition table (GPT) identifier or master boot record (MBR) signature for the disk with focus.Windows
Disk, volume, and partition manager.
Run diskpart by itself in an administrative command prompt to enter its command-line
diskpartIdentifyList all disks
list diskIdentifySelect a volume
select volume volumeIdentifyAssign a drive letter to the selected volume
assign letter letterIdentifyCreate a new partition
create partition primaryIdentifyActivate the selected volume
activeIdentifyExit diskpart
exitIdentify