What is DiskPart?
How to keep your data safe from unstable software
No matter how diligent you are when it comes to computer maintenance and patch management, things can and will go wrong, particularly when it comes to your hard drive.
Fortunately, there are ways to preempt errors or failures, allowing you to perform a great deal of damage limitation before you're even aware of an issue. One such way is to partition your hard disk, separating your operating system and applications from your data. This means that in the event that software encounters a critical error, your files are still recoverable.
Unfortunately, this approach is not an entirely failsafe way to prevent data loss, but it is considered best practice to keep your business-critical data away from potentially vulnerable software in addition to keeping regular backups.
Speaking of backups, partitioning actually makes this process far easier to manage. For example, if you need to reinstall Windows for any reason, your data partition will remain untouched and can be accessed as normal once the installation finishes.
When it comes to partitioning your disk, you have a number of options. Windows comes with its own built-in Disk Management utility which you can use to quickly partition a disk. However, there's also the DiskPart command tool, which offers some extra management options for creating more sophisticated partitions.
What is DiskPart?
DiskPart is a disk partition utility that operates using the command line, designed to be used with all versions of Windows and Windows Server - as long as the software is no older than Windows XP and Windows Server 2003.
The tool essentially allows for more granular control of disk management, including the cleaning and formatting of USB flash drives, and the creation of partitions and assignment of disk drive letters.
Unlike Microsoft's Disk Management tool, DiskPart can be run without Windows starting up and offers explicit control over hard drive volumes and partitions, including surfacing hidden recovery partitions. This makes it a powerful tool and not one to be used without a degree of caution, as any formatting it does on a hard drive cannot be undone once actioned.
DiskPart's power also means it is a useful tool for fixing problems such as data corruption on USB flash drives and SD cards which a simple formatting in Windows cannot fix.
How to use DiskPart
Backing up your data is the most important first step to take into account before proceeding to use DiskPart, or for that matter, any other function that affects the core of your PC. You should only begin the procedure once you’ve established a backup of the data on your hard drive. Users will require admin access to create a partition on the hard drive, which means you may need to recruit the help of your IT team if this proves a blocker. To begin, open the Command Prompt window either by entering ‘command prompt’ into Windows’ search bar or press the Windows key in combination with ‘X’. Click ‘diskpart’ and then press the enter key, as you wait for the tool to open in a new window so you can identify which storage drive you want to partition. Then, enter ‘list disk’ to pull up a list of drives on your machine.
Flash storage fuels IT transformation
Discover the quantified impacts of organisational flash storage useDownload now
Most machines will only have one storage drive, so all you’ll need to do is pick the first and only one that shows up. If you’re confused as to which drive you should use, and you are presented with a range, you’ll have to look into which disk is the best to pick at the risk of partitioning the wrong drive.
When you have found the disk, choose 'select disk' followed by the corresponding number to select the correct one. For example, if the correct disk is the second in the list, type in 'select disk 2' to highlight it and start the partition process.
Again, you will use commands to carry out actions. The 'Extend' command will extend a disk's partition to any unused volume left on the hard drive, while the 'Shrink' command will do the opposite. You can also use 'Clear' to remove all information from a disk, or 'Create' to make a new partition.
When creating a new partition in a drive you will need to ensure you make it active and assign a letter to it using listed commands. To get these commands you can refer to an online guide or can simply type any letter after the 'DISKPART>' line and hit enter to be served up with a selection of compatible commands.
It is worth getting familiar with the command prompts before diving into DiskPart, and the utility is best reserved for IT administrators and people familiar with in-depth hard drive formatting. For those willing to delve into the command-line interface DiskPart should prove to be a powerful hard drive management tool native to Windows.
The IT Pro guide to Windows 10 migration
Everything you need to know for a successful transitionDownload now
Managing security risk and compliance in a challenging landscape
How key technology partners grow with your organisationDownload now
Software-defined storage for dummies
Control storage costs, eliminate storage bottlenecks and solve storage management challengesDownload now
6 best practices for escaping ransomware
A complete guide to tackling ransomware attacksDownload now