CmdID

CmdID / Commands

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

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

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 diskIdentify

To select a disk, run select disk followed by the disk number. For example

select disk 1Identify

Before disk 1 can be utilized, a partition will need to be created by running create partition primary

create partition primaryIdentify

Lastly, 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 quickIdentify
Show 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

from tldr-pages, CC BY 4.0

Disk, volume, and partition manager.

Run diskpart by itself in an administrative command prompt to enter its command-line

diskpartIdentify

List all disks

list diskIdentify

Select a volume

select volume volumeIdentify

Assign a drive letter to the selected volume

assign letter letterIdentify

Create a new partition

create partition primaryIdentify

Activate the selected volume

activeIdentify

Exit diskpart