How to Use Diskpart to Repair Disk

Using Diskpart to repair disk requires users to type complex orders. If you’re not familiar with them, this post can guide you to understand commands and run them to fix disk.

Lucas

By Lucas / Updated on January 24, 2025

Share this: instagram reddit

CMD, short for Command Prompt, is a command-line interpreter available on Windows operating systems. It provides a text-based interface where users can execute commands to interact with the operating system, automate tasks, and troubleshoot system issues.

Using the diskpart tool in Command Prompt can help you repair a disk by performing various operations such as cleaning, formatting, or setting a partition active. However, diskpart is a powerful tool, and improper use can result in data loss, so proceed cautiously and ensure your data is backed up.

Guide of using Diskpart to repair disk

Now, we’ll show you how to use Diskpart to repair disk, and also how to use CHKDSK and SFC to check your disk.

Tool 1. Try Diskpart to repair disk

This method involves the use of the DiskPart program to format your hard disk. The DiskPart program can be used to forcibly format a RAW hard drive to NTFS/exFAT/FAT32. The Disk Management program or the Windows File Explorer can be employed to format the drive.

Step 1. Press “Windows” + “R” to open the Run box, typing “diskpart” and press “Enter”.

Step 2. And then, type the following command and press “Enter” after each.

  • list disk
  • select disk n(here “n” is the disk number of the disk you want to format.)
  • clean
  • create partition primary
  • active
  • select partition 1
  • format fs=ntfs (If you want to format the disk into other file system like FAT32, replace the command with “format fs=fat32”.)

Format ntfs

After that, the corrupted hard disk can be forcefully formatted in a few minutes.

Tool 2. Try CHKDSK to repair corrupted disk

Users can scan for logical and physical disk defects by examining the file system and file system metadata of a specific volume using the check disk software. Furthermore, it is interconnected with numerous controls that are capable of performing a variety of functions.

Step 1. Open Command Prompt as Administrator.

Step 2. Copy and paste the following command and press Enter to execute it: chkdsk C: /F

Check disk

Note: Change C with the letter of the hard drive you want to restore or repair.

Tips: There are a few other parameters you can add to the command line in addition to the /F one:
/f- Locates and corrects all hard drive errors.
/r- Finds any corrupt sectors on the disk and restores readable data.
/x- Unmounts the drive before the procedure begins.
/b- Removes any bad clusters from a disk and rechecks all allocated and free clusters for errors. Use it with NTFS File System.

Step 3. To run a more thorough scan, you can modify the program to include each option.

When an internal drive is repaired, the application will prompt the user to restart the computer. To restart the computer directly from the command prompt, select Y and Enter.

Tool 3. Run SFC and DISKM scan

A corrupt hard drive may be the result of a corrupt file system. Fortunately, the System File Checker tool can be used to rectify and restore the corrupted hard disk. A SFC scan can be conducted by following these steps.

Step 1. As an administrator, launch Command Prompt.

Step 2. For those who use Windows 10 and above, copy and paste the following command and press Enter. Those who are using the earlier versions of Windows need not execute it.

DISM.exe /Online /Cleanup-image /Restorehealth

Restorehealth

After the scan, your computer will automatically establish a connection to the Windows Update service to download and replace corrupt files.

Step 3. Type the command sfc /scannow and press Enter to run it.

The application will commence the process of verifying the integrity of all protected system files and replacing any files that are damaged or absent. Ensure that the Command Prompt remains open until the evaluation has been completed in its entirety.

If the hard drive is external, run the following command:

sfc /scannow /offbootdir=X:\ /offwindir=C:\Windows

Note: Change x: to the letter the external hard drive was assigned. Remember to substitute the location where Windows was installed for C:\Windows as well.

Repair disk via third-party Diskpart alternative tool for Windows 11/10/8/7

Suppose the process of repair disk in CMD is a little complicated. In that case, AOMEI Partition Assistant is a comprehensive and user-friendly disk management tool designed to help users manage and repair disks effectively.

It provides a graphical interface and a wide range of features, making it an excellent alternative to command-line tools like DiskPart. With this software, both novice and advanced users can easily perform disk-related tasks, including partition resizing, formatting, conversion, and repair.

AOMEI Partition Assistant

The Best Windows Disk Partition Manager and PC Optimizer

1. Check Partition for errors

Step1. Install and run AOMEI Partition Assistant. Right-click the partition you want to check and select “Advanced”> “Check Partition”.

Check The C Partition

Step 2. In the pop-out window, you have three options available, check and fix error by using chkdsk.exe, check error only using chkdsk.exe, and find bad sectors. Choose one according to your needs and click “OK”. Then wait for the process to complete.

Check Partition And Fix Errors

Besides, you can also right-click the disk you want to scan and select the “Surface Test” to check disk error.

If checking and repairing disk/partition by chkdsk.exe fails, then you can consider the option of rebuilding the MBR of the damaged hard drive. Luckily, AOMEI Partition Assistant could also perform this task.

2. Rebuild MBR of corrupted hard drive

Step 1. Open AOMEI Partition Assistant, right-click the corrupted disk and select “Rebuild MBR”.

Rebuild Data Disk Mbr

Step 2. Select a proper MBR type for your current operating system and click “OK”.

Choose Mbr Type

Step 3. In the main interface, click “Apply” on the top left corner to commit the pending operation.

Then, you can check whether the corrupted hard drive can be used normally again. If not, you can try to reformat it via this software.

3. Reformat the corrupted hard drive

Step 1. In the main interface of AOMEI Partition Assistant, right-click any partition of the corrupted disk and select “Format Partition”.

Format Partitoin

Step 2. Select a file system (ex: FAT32) and click “OK”.

Fat32 128gb Usb

Step 3. Click “Apply” to start formatting the partition.

Apply

Bonus tips: How to perform boot repair when disk can't boot

If you unfortunately damage your system disk and it can't boot your system, you may need to do boot repair. In this case, AOMEI Partition Assistant has "Boot Repair" function that allows users to create a repair USB on another PC and use it to repair boot failed PC.

Boot repair

Ending lines

Although you can use Diskpart to repair disk in CMD, the complex commands may not suit every user. Luckily, there is AOMEI Partition Assistant that offers several ways to repair disk in just one application. And you can try other functions to improve disk performance or monitor the status of your disks and drives, such as "Disk Clone", "Disk Speed Test", and "PC Cleaner"...

Lucas
Lucas · Staff Editor
I prefer peaceful and quiet life during vacation,but sometimes I watch football match if my favorite club performs brilliantly in that season. And I love reading, painting and calligraphy, thus I send my friends festival handwriting cards every year.