How To Fix Corrupted Hard Drive Using cmd

Written by Barry Allen

September 23, 2022

Fix Corrupted Hard Drive Using cmd


The corruption of storage media that may be internal or external hard drives, flash/pen drives, external memory cards, and other similar devices, is one of the most alarming situations in the computing industry. If the storage media included crucial data, the occurrence could potentially cause a minor heart attack (family pictures or videos, work-related files, etc.). Error warnings such as ‘Sector not found.’ and ‘You must format the disc before you can use it.’ are examples of symptoms that a hard drive is corrupt. ‘Do you want to format it right now?’ ‘X: is unavailable. ‘Access is denied.’, ‘RAW’ status in Disk Management, file names begin to include & * # percent or other symbols, and so forth.
Corruption can now be triggered by a variety of sources, depending on the storage medium. Physical damage (if the hard drive was dropped), a virus assault, file system corruption, faulty sectors, or simple ageing are the most prevalent causes of hard disc corruption. The data from a corrupted hard drive can usually be recovered by fixing/repairing the disc itself if the damage isn’t physical and severe. Both internal and external hard drives include a built-in error checker in Windows. Apart from that, users can repair their infected drives by running a sequence of commands at an elevated command prompt. This article will guide you through the procedure to help you fix a corrupted hard drive using cmd.

Steps To Fix Corrupted Hard Drive Using cmd

Firstly update disk drivers and perform a disk error check and if it does not fix your corrupted hard drive, then move forward to the following methods to fix the hard drive using cmd:

Method 1: Run the SFC Scan

Step 1: To open the Start Search bar, press Windows key + S, type Command Prompt, and pick the option to Run as Administrator.

Step 2: When the User Account Control pop-up appears, requesting permission for the application to make system modifications, select Yes. Users of Windows 10, 8.1, and 8 need first run the software below. Users of Windows 7 can skip this step.

DISM.exe /Online /Cleanup-image /Restorehealth

Step 3: Now, on the Command Prompt, type sfc /scannow and click Enter to run it.

Step 4: The tool will begin by checking the integrity of all protected system files and replacing those that are corrupt or missing. Close the Command Prompt after the verification has reached 100%.

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

If the hard drive is external, instead of sfc /scannow, use the following command:

Note: Replace “x:” with the letter that corresponds to the external hard drive. 

Also, remember to replace “C:Windows” with the location where Windows was installed.

Step 5: When the scan is finished, restart your computer and see whether you can now access the hard drive.

Method 2: Use the CHKDSK utility

Step 1: Relaunch Command Prompt as an administrator.  Type the following command carefully and press Enter to run it.

Note: Change the letter X to the letter of the hard disc you want to repair or fix.

chkdsk X: /F

You can add a few extra parameters to the command line in addition to the /F one. The following are the various parameters and their functions:

/f – Locates and corrects all hard drive errors.

/r – Detects any faulty sectors on the disc and recovers usable data /x – Dismounts the drive before the procedure begins /b – Clears any bad clusters and rescans all allocated and free clusters on a volume for errors (Use with NTFS File System only)

Step 2: To run a more thorough scan, add all of the above options to the command. In that situation, the command line for the G drive would be:

chkdsk G: /F /R /X

Step 3: If you’re repairing an internal hard disc, the application will prompt you to restart your computer. To restart from the command prompt, press Y and then enter.

Method 3: Use the DiskPart command

Step 1: As an administrator, open Command Prompt once more. Use the diskpart command to partition your hard drive. To see all the storage devices attached to your computer, type list disc or list volume and press Enter.

Step 2: Now, using the command, pick disc X or select volume X, and select the disc that has to be formatted. (Instead of X, use the number of the disc you want to format.) After selecting the corrupted disc, run format fs=ntfs quick and press Enter to format it. Use the following command instead if you want to format the drive in FAT32.

format fs=fat32 quick

Step 3: The confirmation message ‘DiskPart successfully formatted the volume’ will appear at the command prompt. To close the elevated command window, type exit and press Enter.


In this article, we have outlined all the steps in order to fix a corrupted hard drive using cmd. If you have any other queries or suggestions, let us know in the comment area.

Read All Windows Related How-To & Fixes here.


Submit a Comment

Your email address will not be published. Required fields are marked *

Related Articles

How do I increase the pin chat limit in WhatsApp?

In the current version of WhatsApp, you can pin an unlimited number of chats. However, by default, the app allows you to pin only up to three chats. Here's a trick to pin more than three chats: 1. Open WhatsApp and pin three chats. When you attempt to pin the fourth...

Is machine learning beginner friendly?

Machine learning is among the most difficult disciplines for novices to understand in AI. While dealing with enormous volumes of data and comprehending complicated mathematical concepts and approaches are necessary for machine learning, most beginners find this...

Stay Up to Date With The Latest News & Updates

Access Premium Content

Join Us to get access of our premium content.

Join Our Newsletter

Join Us to get weekly premium content, straight into your inbox.

Follow Us

We are on Social Media! Follow us.