On Windows 10, when you have external storage (such as a USB flash drive, removable hard drive, or SD card) that stops working as a result of data corruption or another problem, you can use DiskPart to erase everything and start fresh with a clean partition.
DiskPart is command tool that has been around even before Windows 10, and it allows you to use Command Prompt to manage drives, partitions, and volumes when other tools like Disk Management and Format won't work to fix the problem.
In this Windows 10 guide, we'll walk you through the steps to use the DiskPart command tool to clean and properly format a drive to fix corruptions and other disk problems.
How to clean and format a drive using DiskPart
To use DiskPart to fix a hard drive with problems on Windows 10, use these steps:
Important: Using these instructions will erase everything on the selected drive, and you can't undo the changes. If the drive is still accessible, it's recommended to backup your data before proceeding. If you have multiple drives connected to your computer, it's also recommended to disconnect them to minimize the chances of selecting the wrong partition.
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
Type the following command to launch DiskPart and press Enter:
Type the following command to list all the drives connected to your computer and press Enter:
Type the following command to select the drive that you want to clean and press Enter:
select disk 1
In the command, make sure to replace 1 for the drive number that you want to delete. If you don't do this step correctly, you could end up wiping out the wrong drive, as such proceed with caution.
Type the following command to wipe out the drive and press Enter:
Type the following command to confirm the drive still selected and press Enter:
Quick note: The output should include an asterisk (*) next to the selected drive.
Type the following command to create a new partition on the drive and press Enter:
create partition primary
Type the following command to select the new primary partition and press Enter:
select partition 1
Type the following command to make the selected partition active and press Enter:
Type the following command to format the partition using the Microsoft NTFS file system and to set a drive label, and press Enter:
format FS=NTFS label=Data quick
In the command, remember to replace Data for the name of the drive that you want to see when using File Explorer. Also, the quick flag is optional, but if you don't use it, the format will take a long time.
Type the following command to assign a letter and make the drive available in File Explorer and press Enter:
In the command, replace w with the drive letter that you want to use, and it's not assigned by another drive.
Type the following command to terminate DiskPart and press Enter:
Once you complete the steps, if the drive didn't have any physical issues, it should be available through File Explorer, and you can begin storing files on it.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
- Windows 10 on Windows Central – All you need to know
- Windows 10 help, tips, and tricks
- Windows 10 forums on Windows Central
Portable (and affordable) power accessories we love
Each and every one of these charging gadgets will keep your favorite gear and gadgets going for longer, and none of them costs more than $30.
VisionTek 8,000 mAh micro-USB power bank ($13 at Dell)
This compact dual-output powerbank can speedily recharge any and all your devices, thanks to a two-amp "fast charge feature," using its micro-USB out port. Its simple design includes an LED indicator, and it costs about as much as a single ticket to the movies.
Panasonic eneloop AA batteries (From $13 at Dell)
Panasonic's rechargeable batteries are among the best available, and just a couple of them will keep your favorite remote, mice or other peripherals powered up when you need them. They're also eco. And the company's affordable charger fits and charges both AA and AAA batteries at the same time.
Belkin Qi Wireless Charging Pad ($30 at Dell)
This unobtrusive Qi wireless charging pad looks good (and kind of like a UFO …) and easily charges all your Qi-compatible device up to 5W. Its LED indicator lights up when you're charging. And it costs just $30.
We may earn a commission for purchases using our links. Learn more.
The first two Snapdragon 7c PCs are here, and they start at $299 with LTE
Along with a slew of announcements for the education market this week, Microsoft debuted the first two PCs to be powered by Qualcomm's Snapdragon 7c platform. Both are targeted at the education market, and they bring LTE for as little as $299.
Need a laptop with a Thunderbolt 3 port? Every PC here deserves a look.
Looking for a new laptop that has Thunderbolt 3 ports? Well, you're in luck, as we've rounded up what we think are the best Thunderbolt 3 enabled laptops available to buy today.
Windows 10 build 19546 arrives for Fast ring with graphing calculator
Microsoft pushed out another new Windows 10 Preview build for Windows Insiders on the Fast ring today. This build brings the build number up to 19546, and it includes a new graphing mode for the Calculator app.
These are the best PC sticks for when you're on the move
Instant computer, just add a screen! That’s the general idea of the ultra-portable PC Compute Sticks, but it can be hard to know which one you want. Relax, we’ve got you covered.