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.
Microsoft Edge Dev channel gets new collections features, extension sync
Another weekly update is out for the Microsoft Edge Dev channel, and it has a host of handy features to check out. New in this release are a couple of improvements to collections, extension sync, and more.
Join us for the latest Windows Central Video Podcast
We're live with the Windows Central Video Podcast today at 2:30pm ET, make sure you're there!
Are you working from home this week? (poll)
More people are working from home than ever right now, and we're wondering how you all are managing to stay productive in your homebound state. Chime in and let us know in our poll!
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.