In-depth

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.

Advertisement
Advertisement - Article continues below

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. 

Related Resource

Flash storage fuels IT transformation

Discover the quantified impacts of organisational flash storage use

Download 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.

Advertisement
Advertisement - Article continues below

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.

Featured Resources

The IT Pro guide to Windows 10 migration

Everything you need to know for a successful transition

Download now

Managing security risk and compliance in a challenging landscape

How key technology partners grow with your organisation

Download now

Software-defined storage for dummies

Control storage costs, eliminate storage bottlenecks and solve storage management challenges

Download now

6 best practices for escaping ransomware

A complete guide to tackling ransomware attacks

Download now
Advertisement

Most Popular

Visit/security/identity-and-access-management-iam/354289/44-million-microsoft-customers-found-using
identity and access management (IAM)

44 million Microsoft customers found using compromised passwords

6 Dec 2019
Visit/cloud/microsoft-azure/354230/microsoft-not-amazon-is-going-to-win-the-cloud-wars
Microsoft Azure

Microsoft, not Amazon, is going to win the cloud wars

30 Nov 2019
Visit/hardware/354237/five-signs-that-its-time-to-retire-it-kit
Sponsored

Five signs that it’s time to retire IT kit

29 Nov 2019
Visit/business/business-strategy/354195/where-modernisation-and-sustainability-meet-a-tale-of-two
Sponsored

Where modernisation and sustainability meet: A tale of two benefits

25 Nov 2019