Diskpart is an internal tool for Windows operating systems to manage storage units, whether internal or external, and with the capacity to manage disks, partitions, volumes or virtual hard drives.
It is certain that you have ever come across a “rebellious” storage unit (it happens a lot with external drives such as a USB flash drive) that has lost the file system and which is impossible to format with the usual Windows media. Or there are multiple automounted disks causing boot conflicts. Or they have the wrong drive letter.
Or we have problems handling the important section of partitions, the division of storage units in a personal computer for which we offered you a dedicated guide. These are just a few examples of problems that can be solved using Diskpart, an advanced command used from the console on consumer Windows (7, 8.1 or Windows 10) or supported Windows Servers.
Access to Diskpart
To run this tool, the only requirement is that the user belongs to the local administrators group or to a group with similar permissions. From there, the easiest way to access it is through the run command, a quick method to open programs, managers, files, folders or Internet resources, which facilitates interaction with the computer and saves time and effort when working. with Windows and its applications.
We simply press the hotkey combination “Windows + R”, type Diskpart and click on the accept button. (The run command can also be accessed through the alternative start menu, right-clicking on the start button)
Another possibility of access in Windows 10 is by searching the system, typing its name in the search box.
And if you are already using the Windows console, nothing is easier than loading the tool by typing Diskpart.
Diskpart, small, but powerful
In both cases we will arrive at the command prompt with Diskpart executed. Don’t be confused by its apparent simplicity. Its possibilities are manifold and go far beyond the graphical disk and partition management application offered by the operating system.
There are almost 40 commands that we can launch with this tool. Some of the most interesting are:
disk or help: shows the diskpart commands that we can use and a brief description. list: shows all the disks on the computer (list disk); the volumes (list volume); partitions (list partition) or virtual disks of the machine (list vdisk). select – moves focus to a disk, volume, or partition. It is a mandatory command to work with each of them. active: marks the disk partition with focus, as active. assign – Assigns a drive letter or mount point to the volume that has focus. clean: removes all formatting of partitions or volumes from the disk that has focus. create – Create a partition, volume, or virtual disk. extend – Extends the focused volume or partition, along with its file system, into free (unallocated) space. shrink – Shrinks the selected volume by the specified amount. format – Formats a disk in Windows supported file systems.
A simple use case. Cleaning or formatting a problematic storage unit such as a USB pendrive that we cannot access from the graphical interface and without having to resort to external solutions, is a simple example of the possibilities of this application. Only three steps that will take you less than a minute:
Launch Diskpart. Type “list disk” to see the problem drive. For the example number 2. Select the drive with «select disk 2». Type the command “clean” to clean the drive.
You will now have the drive accessible in Windows and ready to be formatted with the file system of your choice. It is a simple and well-known example of this tool, but its use goes much further than that since it allows you to solve problems or manage disks, partitions, volumes or virtual hard drives from the command line. Very useful.