On Windows 10, when your external storage (such as a USB flash drive, portable hard drive or SD memory card) stops data working or something else, you can use the DiskPart command to clear a message. Files stored on this device are accessible and start over with a clean partition.
DiskPart is a command tool that predates Windows 10 and it allows you to use the Command Prompt to manage drives, partitions and fix errors when other tools like Disk Management and Format are not working to fix problems trying.
This tutorial will show you step by step using DiskPart to clean and format your hard drive to fix data corruption errors in the Windows 10 operating system.
How to Fix Hard Drive Problems with Diskpart
To troubleshoot a hard drive with the DiskPart command on Windows 10, follow the instructions below:
Important: These instructions will erase everything on the drive that you cannot change or undo. If the drive is still accessible, you should back up its data before proceeding. If you are using multiple drives on your computer, you should avoid choosing the wrong drive.
Quick Format Disk with DiskPart
Step 1: Open Command Prompt by clicking on the Windows icon in the screen’s left corner and typing “command prompt“. Then right-click on Command Prompt and choose Run as administrator.
Step 2: Type diskpart into the Command Prompt window and press Enter.
Step 3: Type in the command line below and press Enter for each time to quickly format the hard drive:
list disk select disk * list volume select volume * format fs = ntfs quick
- list disk
- select disk 2 (Replace 2 with your drive).
- list volume
- select volume 10 (Replace 10 with the number of partitions you want to format).
- format fs = ntfs quick (If you need to format your hard drive partition to FAT32 or other file systems, replace NTFS with FAT32, exFAT, etc.).
If you accidentally enter a format without “fs = ntfs quick or fs = fat32 quick” in the Command Prompt Diskpart window, it will perform a full format on your selected hard drive partition.
This command will also delete all saved data by region. In other words, you will permanently lose all deleted data on the drive with no chance of recovery.
Step 4: Type exit and press Enter to close the program when DiskPart reports that it has successfully formatted the drive.
Clean Disk with DiskPart command
Step 1: On Windows 10, press the Windows + X shortcut, select Search or open the Start Menu and type”cmd”, then right-click on it and select Run as administrator.
Step 2: On the Command Prompt window, type diskpart and press Enter.
Step 3: Next, type “list disk” and press Enter.
All drives will be listed, including your external drives connected to your computer.
Step 4:Look in the list of disk list. Type select disk + disk number. For example and “select disk 2″ and press Enter.
You are asking DiskPart to locate and select drive 2 to clean and format it in the next steps.
Step 5: Continue typing “clean“. This step will start deleting all the above files and folders on your selected hard disk.
Step 6: Type “create partition primary” and press Enter.
Step 7: After DiskPart successfully created the specified partition, type format fs = ntfs (or format fs = exfat) and press Enter. You ask DiskPart to format the drive to a specific file system, let it be NTFS, exFAT, etc.
Step 8: Finally, assign the drive letter to the newly created area by typing the “assign” command.
Step 9: Type “exit” to close the DiskPart Command Prompt window when the process is finished.
So you already know to use the Diskpart in Windows 10 and Windows 7 and 8.1, right? Hopefully, this article will help you and if you have any other questions or suggestions related to the article or about Windows, do not forget to leave your comments below.