One of the most terrifying incidents that can happen in the tech world is the corruption of storage media such as internal or external hard drives, flash drives, memory cards, etc. The incident can even prompt a mini heart attack if the storage media contained some important data (family pictures or videos, work-related files, etc.). A few signs that indicate a corrupt hard drive are error messages like ‘Sector not found.’, ‘You need to format the disk before you can use it. Do you want to format it now?’, ‘X:\ is not accessible. Access is denied.’, ‘RAW’ status in Disk Management, file names start including & * # % or any such symbol, etc.
Now, depending on the storage media, corruption may be caused by different factors. Hard disk corruption is most commonly caused due to physical damage (if the hard disk took a tumble), a virus attack, file system corruption, bad sectors, or simply due to age. In most cases, if the damage isn’t physical and severe, the data from a corrupted hard disk can be retrieved by fixing/repairing the disk itself. Windows has a built-in error checker for both internal and external hard drives. Apart from that, users can run a set of commands in an elevated command prompt to fix their corrupted drives.
In this article, we will show you multiple methods that can be employed to repair or fix corrupted hard drive in Windows 10.
How to Repair or Fix Corrupted Hard Drive Using CMD?
Firstly, ensure you have a backup of the data contained in the corrupted disk, if not, use a third-party application to retrieve the corrupted data. Some popular data recovery applications are DiskInternals Partition Recovery, Free EaseUS Data Recovery Wizard, MiniTool Power Data Recovery Software, and Recuva by CCleaner. Each of these has a free trial version and a paid version with additional features. We have an entire article dedicated to various data recovery software and the features they offer – 9 Best Free Data Recovery Software.
Also, try connecting the hard drive USB cable to a different computer port or to another computer altogether. Ensure the cable itself isn’t faulty and use another one if available. If corruption is caused due to a virus, perform an antivirus scan (Settings > Update & Security > Windows Security > Virus & threat protection > Scan now) to remove the said virus and repair the hard drive. If none of these quick fixes worked, move to the advanced solutions below.
5 Ways to Fix Corrupted Hard Drive using Command Prompt (CMD)
Method 1: Update Disk Drivers
If the hard drive can be successfully used on another computer, chances are, your disk drivers need updating. Drivers, as many of you might know, are software files that help hardware components effectively communicate with your computer’s software. These drivers are constantly updated by hardware manufacturers and they can be rendered corrupt by a Windows update. To update the disk drivers on your computer-
1. Open the Run command box by pressing Windows key + R, type devmgmt.msc, and click on OK to open the Device Manager.
2. Expand Disk Drives and Universal Serial Bus Controllers to find the corrupted hard drive. A hardware device with outdated or corrupt driver software will be marked with a yellow exclamation mark.
3. Right-click on the corrupted hard disk and select Update Driver.
4. In the following screen, choose ‘Search automatically for updated driver software’.
You can also manually download the latest drivers from the hard drive manufacturer’s website. Simply perform a Google search for ‘*Hard drive brand* drivers’ and click on the first result. Download the .exe file for the drivers and install it as you would any other application.
Method 2: Perform Disk Error Checking
As mentioned earlier, Windows has a built-in tool to fix corrupted internal and external hard drives. Usually, Windows automatically prompts the user to perform an error check as soon as it detects a faulty hard drive is connected to the computer but users can also run the error scan manually.
1. Open Windows File Explorer (or My PC) by either double-clicking on its desktop shortcut icon or using the hotkey combination Windows key + E.
2. Right-click on the hard drive you are trying to fix and select Properties from the ensuing context menu.
3. Move to the Tools tab of the Properties window.
4. Click on the Check button under the Error-checking section. Windows will now scan and fix all the errors automatically.
Method 3: Run the SFC Scan
The hard drive may also be misbehaving due to a corrupt file system. Fortunately, the System File Checker utility can be used to repair or fix the corrupted hard drive.
1. Press Windows key + S to bring up the Start Search bar, type Command Prompt and select the option to Run as Administrator.
2. Click on Yes in the User Account Control pop-up that arrives requesting permission for the application to make changes to the system.
3. Windows 10, 8.1, and 8 users should run the below command first. Windows 7 users can skip this step.
DISM.exe /Online /Cleanup-image /Restorehealth
4. Now, type sfc /scannow in the Command Prompt and press Enter to execute.
5. The utility will start verifying the integrity of all protected system files and replace any corrupt or missing files. Do not close the Command Prompt until the verification reaches 100%.
6. If the hard drive is an external one, run the following command instead of sfc /scannow:
sfc /scannow /offbootdir=X:\ /offwindir=C:\Windows
Note: Replace the “x:\” with the letter assigned to the external hard drive. Also, don’t forget to replace “C:\Windows” with the directory in which Windows has been installed.
7. Restart your computer once the scan completes and check if you can access the hard drive now.
Method 4: Use the CHKDSK utility
Along with the system file checker, there is another utility that can be used to repair corrupted storage media. The check disk utility allows users to scan for logical as well as physical disk errors by checking the file system and file system metadata of a specific volume. It also has a number of switches associated with it to perform specific actions. Let’s see how to fix corrupted hard drive using CMD:
1. Open Command Prompt as an Administrator once again.
2. Carefully type the following command and press Enter to execute it.
chkdsk X: /F
Note: Replace X with the letter of the hard drive you wish to repair/fix.
Apart from the /F parameter, there are few other ones that you can add to the command line. The different parameters and their function are as follows:
- /f – Finds and fixes all the errors on the hard drive.
- /r – Detects any bad sectors on the disk and recovers readable information
- /x – Dismounts the drive before the process starts
- /b – Clears all the bad clusters and rescans all allocated and free clusters for error on a volume (Use with NTFS File System only)
3. You can add all the above parameters to the command to run a more meticulous scan. The command line for the G drive, in that case, would be:
chkdsk G: /F /R /X
4. If you are repairing an internal drive, the program will ask you to perform a computer restart. Press Y and then enter to restart from the command prompt itself.
Method 5: Use the DiskPart command
If both the above command-line utilities failed to repair your corrupted hard drive, try formatting it using the DiskPart utility. The DiskPart utility allows you to forcefully format a RAW hard drive to NTFS/exFAT/FAT32. You can also format a hard drive from the Windows File Explorer or the Disk Management application (How to Format Hard Drive on Windows 10).
1. Launch Command Prompt again as an administrator.
2. Execute the diskpart command.
3. Type list disk or list volume and press Enter to view all the storage devices connected to your computer.
4. Now, select the disk that needs to be formatted by executing the command select disk X or select volume X. (Replace X with the number of the disk you would like to format.)
5. Once the corrupted disk is selected, type format fs=ntfs quick and hit Enter to format that disk.
6. If you want to format the disk in FAT32, use the following command instead:
format fs=fat32 quick
7. The command prompt will return a confirmation message ‘DiskPart successfully formatted the volume’. Once done, type exit and press Enter to close the elevated command window.
- Fix Faulty Hardware corrupted page error on Windows 10
- How to Repair Corrupted AVI Files For Free
- How to Use the Fn Key Lock in Windows 10
We hope this guide was helpful and you were able to repair or fix corrupted hard disk drive using CMD in Windows 10. If you weren’t, keep an ear out for any clicking noises when you connect the hard drive to your computer. Clicking noises imply that the damage is physical/mechanical and in that case, you will need to contact the service center.