diskpart /add /delete device_name drive_name partition_name size
Use this command to manage the partitions on your hard disk volumes.
- /add: Creates a new partition.
- /delete: Deletes an existing partition.
- device_name: The device name for creating a new partition.
The name can be obtained from the output of the MAP command, for example:
\Device\HardDisk0.
- drive_name: A drive-letter based name for deleting an existing partition, for example D:
- partition_name: The partition-based name for deleting an existing partition and can be used in place of the drive name argument, for example:
\Device\HardDisk0\Partition1.
- size: The size of the new partition in megabytes.
NOTE: If no arguments are used, a user interface for managing your partitions is displayed.
WARNING: This command can damage your partition table if the disk has been upgraded to a dynamic disk configuration. Do not modify the structure of dynamic disks unless you are using the Disk Management tool.