How to use DiskPart to clean and format drive not working on Windows 10
If a drive is causing problems on Windows 10, it could be a logical issue that can be fixed with a few commands.
When you purchase through links on our site, we may earn an affiliate commission.Here’s how it works.
OnWindows 10, you can use the DiskPart tool to resolve virtually any logical problem with a storage drive, and in this guide, I’ll outline the steps that I typically use to fix most issues (such as data corruption or other logical problems) using DiskPart.
DiskPartis a command-line tool to manage drives, partitions, volumes, and virtual disks through Command Prompt. Usually, it works better than other tools like “Disk Management” and the “Format” feature available on File Explorer.
On Windows 10, you can have different partition styles, including Master Boot Record (MBR) and GUID Partition Table (GPT). TheMBRis the legacy partition style for the standard Basic Input/Output System (BIOS). TheGPTis a newer partition style, usually found in Unified Extensible Firmware Interface (UEFI) computers. The difference between the two is that GPT is meant to replace MBR since it supports more than four partitions, and it’s required on drives with more than 2TB of space. You typically want to use GPT, but MBR is also a good option for external storage. These instructions will help you use DiskPart on either partition style.
These steps will erase everything on the selected drive, and you cannot undo the changes. If the drive is still accessible, it’s recommended to back up the data before proceeding. If multiple drives are connected to your device, disconnect them to avoid selecting the wrong one.
In thishow-to guide, I will walk you through the steps to use DiskPart to clean and format a hard drive to fix data corruption and other problems on Windows 10.
How to fix drive (MBR) problems with DiskPart on Windows 10
To fix drive issues on Windows 10 with DiskPart, use these steps:
In the command, replace"DISK-NUMBER"with the drive number you want to repair as it appears in the “Disk” column. You could erase the wrong drive if you do not perform this step correctly.Proceed with caution.
Get the Windows Central Newsletter
All the latest news, reviews, and guides for Windows and Xbox diehards.
In the command, replace"FILE-SYSTEM"with the name of the file system to use, such as"NTFS"or"FAT32,“and replace"DRIVE-LABEL"with the name of the drive as you want it to appear on File Explorer. The"quick"option isn’t required, but it will perform a format faster. However, it’s best to skip the option if you are unsure about the drive’s condition. The format could take a long time, depending on the hard drive’s size. This example formats the drive using the NTFS file system and names the partition “myData”:format fs=ntfs label=myData quick
In the command, change"DRIVE-LETTER"for the letter to use on the drive, which is not assigned to another device. This example assigns the “G” letter:assign letter=g
Once you complete the steps, if the drive does not have physical issues, it should be accessible again through File Explorer.
How to fix drive (GPT) problems with DiskPart on Windows 10
To use DiskPart to fix drive issues with GPT partition style, use these steps:
In the command, replace"DISK-NUMBER"with the drive number to repair, as it appears in the “Disk” column.
In the command, replace"FILE-SYSTEM"with the name of the file system you want to use, such as"NTFS"or"FAT32,“and replace"DRIVE-LABEL"with the name of the drive as you want it to appear on File Explorer. The quick option is optional to perform a format faster. However, if you are unsure about the drive’s condition, it is best to skip the option. The format could take a long time, depending on the hard drive’s size. This example formats the drive using the NTFS file system and names the partition “myData”:format fs=ntfs label=myData quick
In the command, change"DRIVE-LETTER"for the letter to use on the drive, which is not assigned to another device. This example sets the “W” letter:assign letter=w
After you complete the steps, the drive should be fixed with a GPT partition style and accessible from File Explorer.
More resources
For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources:
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.