Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Fix a Corrupted Hard Drive Using CMD

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can repair logical corruption on a hard drive using the Command Prompt utility CHKDSK (Check Disk) in Windows. This process scans the drive's file system for errors, fixes bad sectors, and recovers readable information, often resolving issues that prevent the drive from opening or cause the computer to freeze when accessing files. It is a built-in Windows tool designed specifically to maintain disk integrity without requiring third-party software.

What You'll Need

  • Administrator Access: You must have an administrator account on the Windows computer to run the necessary commands.
  • Drive Letter: Identify the letter assigned to the corrupted drive (e.g., C:, D:, E:). If the drive does not appear in File Explorer, you may need to assign a letter using Disk Management before proceeding.
  • Power Connection: For laptops, ensure the device is plugged into a power source, as disk repairs can take time and interrupting the process can cause further damage.
  • Backup (Recommended): If the drive is accessible enough to copy files, back up important data before attempting repairs. While CHKDSK aims to preserve data, severe corruption can sometimes result in file loss during the repair process.

Step-by-Step

  1. Open Command Prompt as Administrator
    Press the Windows Key on your keyboard and type cmd. In the search results, right-click "Command Prompt" and select Run as administrator. If prompted by User Account Control (UAC), click Yes to grant permission. You must run the tool with elevated privileges; a standard command prompt window will not have the rights to repair system drives.
  2. Identify the Drive Letter
    If you do not already know the letter of the corrupted drive, open File Explorer and look under "This PC" or "My Computer." Note the drive letter (such as D: or E:) that corresponds to the storage device giving you errors. If the drive does not have a letter, you will need to open Disk Management (press Windows Key + X and select Disk Management), right-click the drive, and choose "Change Drive Letter and Paths" to assign one before you can scan it.
  3. Enter the CHKDSK Command
    In the Command Prompt window, type the following command and press Enter:
    chkdsk X: /f /r
    Replace X: with the actual letter of your corrupted drive. The /f parameter tells the system to fix errors on the disk. The /r parameter locates bad sectors and recovers readable information, which is essential for physical corruption. Using both parameters provides the most thorough repair.
  4. Handle "Volume in Use" Errors
    If you are scanning the system drive (usually C:), Windows may display a message stating that the volume is in use and asking if you want to schedule the check for the next system restart. Type Y and press Enter. You will need to restart your computer for the scan to run. If you are scanning a secondary drive (like an external hard drive or a secondary internal partition), the scan will usually begin immediately.
  5. Wait for the Scan to Complete
    Allow the process to finish without interruption. The time required depends on the size of the drive and the severity of the corruption; it can range from a few minutes to several hours. You will see a progress percentage on the screen. Do not turn off the computer or disconnect the drive during this process.
  6. Review the Results
    Once the scan finishes, the Command Prompt will display a summary report. Look for a line stating "Windows has checked the file system and found no problems" if the repair was successful. If the tool fixed errors, it would list the actions taken, such as correcting file record segments or marking bad sectors. You can then close the Command Prompt and attempt to access your files.

Common Mistakes

One frequent error is typing the wrong drive letter, which results in scanning a healthy drive while the corrupted one remains broken. Always double-check the letter in File Explorer before running the command. Another mistake is interrupting the scan because it appears frozen; CHKDSK often pauses at certain percentages (like 10%, 27%, or 72%) for long periods while processing complex file system issues. Patience is critical—forcing a shutdown during this phase can corrupt the file system further. Users also often forget to run Command Prompt as an administrator, resulting in "Access Denied" errors.

Tips

If the drive is physically failing (making clicking or grinding noises), stop using CHKDSK immediately. The stress of a deep scan can accelerate physical failure, making professional data recovery impossible. In this scenario, disconnect the drive and consult a data recovery specialist. For external drives, try using a different USB port or cable before running software repairs, as a faulty connection can mimic corruption errors. If you only want to check for errors without fixing them (to see if repair is needed), you can run the command without the /f switch, though this is rarely useful for a drive already showing symptoms.

Troubleshooting

If CHKDSK fails to run or returns an error like "The type of the file system is RAW," the file system structure is too damaged for the standard tool to recognize. In this case, you will need to use a dedicated partition recovery tool or check if the drive appears in Disk Management. If the drive shows "0 bytes" or "No Media," the issue is likely hardware failure rather than logical corruption. If the computer freezes every time you plug in the drive, try booting into Safe Mode to run the scan, as this prevents third-party applications from interfering with the disk access.

Frequently Asked Questions

Will CHKDSK delete my files?

The primary goal of CHKDSK is to repair the file system so you can access your files. However, if a file is located in a bad sector, the tool may move the readable fragments to a new location, but the file itself might be partially or fully corrupted and unusable. It does not intentionally delete healthy files, but data loss is a risk with severe corruption, which is why backing up data beforehand is strongly recommended.

Can I stop the CHKDSK scan once it has started?

You should not stop the scan. If you scheduled it for the system drive at boot, you have a brief window to cancel it by pressing a key within the first few seconds of the computer restarting. Once the scan begins, interrupting it can leave the file system in an inconsistent state, potentially causing more damage than the original error.

What does the "/f" parameter do?

The /f parameter fixes logical file system errors on the disk. This includes issues like cross-linked files (where two files claim the same cluster) or inconsistent timestamps. It is the standard repair switch for file system corruption.

What is the difference between /f and /r?

The /f switch only fixes logical software errors in the file system. The /r switch includes all the functions of /f but also physically scans the disk surface for bad sectors and attempts to recover readable data from them. Using /r takes much longer but is more comprehensive for drives that are crashing or dropping files.

Why does the scan stop at a certain percentage for a long time?

It is normal for CHKDSK to appear stuck at specific percentages, often 10%, 27%, or 72%. The tool is likely processing a large number of bad sectors or complex file fragments. This indicates the drive has physical issues or heavy corruption. If it remains stuck for over 24 hours, the drive may have completely failed.

Can I use this method on a Mac?

No, CHKDSK is a Windows-specific command. On macOS, the equivalent tool is Disk Utility's First Aid feature. You can access it by opening Disk Utility (found in Applications > Utilities), selecting the drive, and clicking "First Aid."