sodcalculator

10 Tech How-To

How to Repair a Corrupted Hard Drive

Guide 10-57100 · Updated · Step by step

This guide walks you through the practical steps to repair a corrupted hard drive on Windows, macOS, or Linux. You’ll learn how to diagnose the issue, use built-in tools to fix file system errors, recover data if needed, and know when professional help is required.

What You’ll Need

  • A computer with the corrupted drive connected (internally or via USB adapter)
  • Administrator or root access to the operating system
  • Backup drive or cloud storage for recovered files
  • Optional: a second computer to create bootable repair media
  • Optional: data recovery software (free or paid) if files are inaccessible

Step-by-Step

  1. Back up critical data immediately (if possible). If the drive is still recognized by the OS and you can access some files, copy them to another drive or cloud storage first. Do not attempt repairs before backing up, as some tools can worsen data loss.
  2. Identify the type of corruption. Common signs include: drive not recognized, files disappearing, error messages like “The file or directory is corrupted and unreadable,” or the drive showing as RAW. Note the drive letter (e.g., D:) or device name (e.g., /dev/sdb).
  3. Run a filesystem check (Windows). Open Command Prompt as Administrator (right-click Start > Command Prompt (Admin) or Windows PowerShell (Admin)). Type chkdsk X: /f /r (replace X with the drive letter). The /f flag fixes errors, /r locates bad sectors and recovers readable information. If the drive is in use, you’ll be prompted to schedule the check on next restart. Allow the process to complete, which may take hours for large drives.
  4. Run a filesystem check (macOS). Open Disk Utility (Applications > Utilities > Disk Utility). Select the corrupted drive in the sidebar, then click “First Aid” and “Run.” This will verify and repair the filesystem. If the drive is your startup disk, you may need to boot into Recovery Mode (hold Command+R at startup) and run First Aid from there.
  5. Run a filesystem check (Linux). Unmount the drive first: sudo umount /dev/sdb1 (replace with your device). Then run sudo fsck -f /dev/sdb1. Add -y to automatically answer “yes” to prompts. Do not run fsck on a mounted drive.
  6. If the drive is RAW or unreadable, use TestDisk. TestDisk is a free, open-source tool that can rebuild the partition table and recover deleted partitions. Download it from the official website, extract, and run testdisk from the command line. Follow the prompts: select the drive, choose the partition table type (usually Intel for Windows), then “Analyse” and “Quick Search.” If it finds the missing partition, select it and choose “Write” to restore it. This can fix drives that show as RAW without losing data.
  7. Recover files with data recovery software. If the filesystem is beyond repair, use tools like Recuva (Windows), PhotoRec (cross-platform, works with TestDisk), or Disk Drill (macOS/Windows). Install the software on a different healthy drive, connect the corrupted drive, and scan. Save recovered files to a different drive to avoid overwriting.
  8. Check S.M.A.R.T. status. Use tools like CrystalDiskInfo (Windows) or smartctl (Linux, macOS) to check the drive’s health. If S.M.A.R.T. reports reallocated sectors, pending errors, or imminent failure, the drive is physically failing. Back up immediately and replace it.
  9. Format the drive as a last resort. If the drive is empty or data recovery is not needed, formatting will rebuild the filesystem. In Windows, right-click the drive in File Explorer > Format. In macOS, use Disk Utility > Erase. In Linux, use sudo mkfs.ext4 /dev/sdb1 (or your preferred filesystem). This erases all data permanently.
  10. Test the drive after repair. After running chkdsk or fsck, try copying files to and from the drive. If errors persist, the drive may have physical damage. Consider replacing it.

Common Mistakes

  • Running chkdsk on a failing drive without backing up. This can accelerate data loss if the drive is physically failing.
  • Using the wrong command. On Linux, running fsck on a mounted drive can cause severe corruption. Always unmount first.
  • Ignoring S.M.A.R.T. warnings. If the drive is reporting hardware issues, software repairs won’t fix it permanently.
  • Writing new data to the corrupted drive. This can overwrite recoverable files. Use a different drive for the OS and recovery tools.
  • Assuming formatting is a repair. Formatting only creates a new filesystem; it does not fix physical bad sectors.

Tips

  • Always keep a backup of important data. Use the 3-2-1 rule: 3 copies, 2 different media, 1 offsite.
  • If the drive is making clicking or grinding noises, power it off immediately. These are signs of physical failure, and continued use can cause further damage.
  • For external drives, try a different USB cable and port. A faulty cable can cause errors that mimic corruption.
  • Use a live Linux USB to access the drive if your main OS won’t boot. This can help you copy files before attempting repairs.
  • If the drive is under warranty, check with the manufacturer before opening it or attempting repairs that could void the warranty.

Troubleshooting

  • chkdsk or fsck reports “Cannot lock the drive” or “Device or resource busy.” Close all programs using the drive, or run the check from a bootable environment (e.g., Windows Recovery Environment, Linux live USB).
  • The drive is not recognized at all. Check BIOS/UEFI to see if the drive is detected. If it appears in BIOS but not in the OS, the partition table may be corrupt. Use TestDisk to rebuild it.
  • Recovery software finds files but they are corrupted. This often happens with physical damage. Use a more advanced recovery tool or consider professional data recovery services.
  • chkdsk freezes or takes forever. This can indicate severe physical damage. Let it run overnight if possible; if it remains stuck for 24 hours, the drive may be beyond software repair.
  • After repair, the drive works but data is missing. Check the Recycle Bin, or use recovery software to scan for deleted files. Sometimes files are moved to a hidden folder like found.000 on Windows.
  • Errors persist after chkdsk. The drive may be failing. Run S.M.A.R.T. diagnostics and replace the drive if errors are hardware-related.

Frequently Asked Questions

Can a corrupted hard drive be repaired without losing data?

Yes, in many cases. Running chkdsk or fsck can fix filesystem errors without deleting files. However, if the corruption is severe or physical, data loss may be unavoidable. Always back up first.

What does “RAW” mean on a hard drive?

RAW means the filesystem is unrecognizable by the OS. This can happen due to partition table corruption, bad sectors, or a failed format. TestDisk can often recover the partition and make the drive accessible again.

How long does chkdsk take?

It varies widely. A small drive with minor errors may take minutes; a large drive with many bad sectors can take hours or even days. Let it run uninterrupted.

Is it safe to use a drive after chkdsk finds bad sectors?

If chkdsk marks bad sectors and the drive still works, you can continue using it, but it’s a sign of aging. Backup regularly and monitor S.M.A.R.T. status. If bad sectors increase, replace the drive.

Can I repair a physically damaged hard drive at home?

No. Physical damage (clicking, grinding, head crashes) requires cleanroom facilities and specialized equipment. Attempting DIY repairs will likely worsen the damage. Contact a professional data recovery service.

What is the difference between chkdsk /f and /r?

/f fixes filesystem errors. /r locates bad sectors and recovers readable data. /r implies /f, so running chkdsk /r is more thorough but slower.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →