Last Updated on May 21, 2026
Managing the hard drive on your computer is not something that most PC users tend to get into. It’s more of a thing reserved for the techy type people or those who work on computers for a living. Regardless of your skill level, it’s always a good idea to know how to manage your hard drives in case you need to fix a problem or simply want to get some information about them.
Before diving into any specific tools, it helps to understand why basic disk management matters in everyday Windows use. Your hard drive stores everything from the operating system and applications to personal files, and over time it can become cluttered, misconfigured, or inefficient. Tasks like checking available storage, managing partitions, or identifying drive issues can improve performance, prevent data loss, and help your PC run more smoothly. Having a general awareness of how Windows handles storage gives you more control and confidence, even if you’re not a computer expert.
Many Windows users like to use the built in Disk Management tool to manage their drives. This will work fine for most tasks and is fairly easy to use.

1. Open an Administrative Command Prompt
To use the DiskPart command in Windows, you will need to open an administrative command prompt. Search for the command prompt tool in your taskbar and run it strictly as an administrator. Type in diskpart and press enter. You will then be presented with the active DISKPART> prompt.

2. View Your Drives with the List Command
One of the first commands you will use is the list command. You must append specific target words after the list command to filter your results. Type list disk to view physical drives or list volume to view your active partitions. You can also run list partition or list vdisk to view virtual disks. The utility prints out specific information depending on which command you use.


3. Choose a Target with the Select Command
When it comes time to working with a specific disk you will need to select that disk first. Type select disk followed by the specific disk number pulled from your previous list command output. The console will print a confirmation message stating that your chosen drive is now the selected disk.

Once you have a disk selected, then you can take specific actions on that disk. Here is a listing of the more common DiskPart commands broken down into executable steps.
4. Access the Help Menu
You can display information about the available commands and their usage by typing help or /? directly into the prompt. This pulls up a massive reference guide right inside your console window. Use this built in manual whenever you forget the required syntax for a rare command.
5. Automate Tasks with Scripts
Network administrators often use the /s parameter followed by a text file path to run automated storage tasks. This tells the utility to read a script file containing a predefined sequence of DiskPart commands. Running automated scripts saves massive amounts of time when configuring dozens of identical workstations.
6. List Disks and Volumes
The /l or list command pushes a clean table of all the disks and volumes on the computer to your screen. It provides critical hardware information such as the disk number, online status, total size, and remaining free space. Checking this table prevents you from accidentally targeting the wrong physical hard drive.
7. Select a Target Disk
The /select command locks onto the specified disk and makes it the active focus for subsequent DiskPart commands. You must always lock onto a specific drive before attempting to wipe or reformat it. This required step acts as a rigid safety mechanism to prevent accidental data destruction.
8. Bring an Offline Disk Online
You can force an inactive storage drive to connect to Windows using the /online command. This proves incredibly useful for activating a disk that a user previously set to an offline state. The operating system will instantly recognize the physical drive and mount the file system.
9. Take a Disk Offline
Typing the /offline command instantly disconnects the selected drive from the Windows operating system. System builders rely on this function for safely removing a physical disk from a hot swap server bay. Taking the drive offline prevents file corruption while the mechanical platters spin down.
10. Wipe Drives with the Clean Command
The /clean command completely removes all partition formatting or hidden volumes from your selected disk. This process effectively wipes out all readable data on the drive in a matter of seconds. Use this tool when a corrupted flash drive blocks standard Windows formatting attempts.
11. Create a Primary Partition
You can carve out fresh usable storage space by typing /create partition primary on an empty disk. The tool will automatically consume all available free space unless you specify an exact limit. Appending the optional size parameter allows you to dictate the exact partition boundaries in megabytes.
12. Format the Selected Partition
The /format command prepares your newly created partition to hold files and folders. Options include specifying the filesystem, assigning a volume label, picking the unit size, and performing a quick format. Always add the word quick to the end of your syntax to skip the incredibly slow disk sector check.
13. Assign a Drive Letter
Windows will not mount your new partition in File Explorer until you run the /assign letter command. You must specify a target letter for the operating system to use. The formatted drive will immediately pop up in your taskbar once the system processes the assignment.
14. Extend a Volume
You can increase the size of an existing partition using the /extend command. The system grabs contiguous unallocated space on the physical disk and merges it directly into your active volume. Adding the optional size parameter limits the exact amount of megabytes added to the drive.
15. Shrink an Existing Volume
The /shrink command reduces the total size of your selected volume to free up unallocated space. The optional desired parameter specifies your exact target size, and the optional minimum parameter specifies the hard minimum size limit. The tool safely compresses your existing filesystem without destroying your saved documents.
16. Delete an Unwanted Partition
Typing /delete partition completely destroys the active volume and sends its allocated space back into the free pool. Windows normally blocks users from deleting hidden recovery sectors or system partitions. You must append the override parameter to force the utility to delete stubborn OEM partitions.
17. Convert the Disk Format
The /convert command alters the fundamental boot architecture of your selected physical disk. You can convert the disk to either the Master Boot Record format or the GUID Partition Table format. Modern Windows 11 installations strictly require the GPT format to boot correctly.
18. Securely Wipe a Hard Drive
Typing /clean all triggers a deep sector wipe across the entire surface of the selected disk. The utility performs a secure wipe by zeroing out the data across every single storage block. This intense erasure process takes hours to complete on large mechanical hard drives.
19. Change Volume Attributes
You can modify advanced disk properties using the /attributes command. This sets or clears hardware attributes on the selected volume. Administrators use this syntax to permanently hide a partition or force a specific drive into a read only state.
20. Exit the Utility
You must type /exit to safely close the active DiskPart session. This gracefully terminates the background storage service and returns you to the standard Windows command prompt. Proper syntax ensures no active formatting tasks suffer corruption.
For additional training resources, check out our online IT training courses.
Check out our extensive IT book series.






