13 views
# DiskPart Commands: Complete List of Disk Management Commands ![](https://i.imgur.com/Krcb10o.jpeg) Managing storage on a Windows computer can feel a lot less annoying once you understand what the operating system already includes. DiskPart is a command-line tool, kind of like a utilities Swiss Army knife, that helps you deal with disks, partitions, and volumes. It gives more hands-on control than many “clicky” graphical interfaces; however, it should be used with care because the wrong command, even a small one, can cause real data loss. ## Overview of DiskPart **[DiskPart](https://datarecovee.com/knowledge-base/diskpart-commands/)** is a Windows command-line utility made to manage storage devices. You can use it to see disks, view partitions, create new partitions, format volumes, assign drive letters, and generally handle disk-management duties without relying on a GUI. It has been part of Windows since the Windows 2000 era, and it shows up on both client and server editions. ## How can you open DiskPart? To start, open Windows Terminal, Command Prompt, or PowerShell with administrator privileges. Then type diskpart and hit Enter. After that, you’ll land in the **DiskPart command** interface, where you can run storage-management commands. Admin access really matters, because a lot of DiskPart actions actually change the storage layout on the computer, not just display info. ## Learn the Focus-Based System DiskPart works around a basic rule: you pick, or “focus” on, a specific storage object before doing anything to it. First, figure out which disk, partition, or volume you want to handle. Next, select it using the suitable command, and only after that do the real operation. For example, list disk shows the disks you have. Then select disk X (with the proper number) to focus on the disk you chose. Afterward, you can run list partition to show the partitions that belong to the selected disk. ## Create and Format a Partition DiskPart can also prep a brand-new storage target. After you select the right disk, you can create a primary partition using create partition primary. After this, you can select the partition and format it using a suitable file system, such as NTFS. ## List of Useful Diskpart Commands The major **diskpart commands** are as follows: * **Active** - Sets the chosen partition as active. * **Add** - Adds a mirror to the selected simple volume. * **assign**- Gives a drive letter or mount point to a volume. * **Attach vdisk** - Connects a virtual hard disk (VHD) so you can use it. * **Attributes** - Views, changes, or clears disk or volume attributes. * **Automount** - Turns automatic volume mounting on or off. * **Break** - Splits a mirrored volume into two separate simple volumes. * **Clean** - Wipes partition and volume formatting from the chosen disk. * **Compact vdisk** - Shrinks the physical size of a growing VHD file. * **Convert** - Changes a disk’s partition or file system format to something else that’s supported. * **Create** - Makes a partition, volume, or VHD. * **Delete** - Removes the chosen partition or volume. * **detach vdisk** - Disconnects a VHD from the host computer. * **Detail** - Shows more info about the chosen disk, partition, volume, or VHD. * **Exit** - Closes DiskPart. * **Expand vdisk** - Grows a VHD to a new size. * **Extend** - Expands a volume or partition into free space. * **Filesystems** - Lists the current and supported file systems for a volume. * **Format** - Formats a disk or volume. * **Gpt** - Sets GPT-related attributes on the chosen partition. Use the website **[Datarecovee](https://datarecovee.com/)** to learn how these DiskPart commands are used.