Skip to main content
File System Repair

Understanding and Fixing Common File System Errors

File system errors are the digital equivalent of a library where someone randomly rearranged the card catalog and then spilled coffee on half the index cards. Your operating system depends on the file system to keep track of where every file and folder lives on the disk, so when that structure gets corrupted, things start breaking in confusing ways. Files disappear, folders become unreadable, and your computer might refuse to boot altogether. But here's the good news: most common file system errors are fixable using built-in tools, and you don't need to be a system administrator to run them safely. This guide will walk you through what these errors actually mean, how to diagnose them, and the step-by-step process to repair your file system without making things worse.

File system errors are the digital equivalent of a library where someone randomly rearranged the card catalog and then spilled coffee on half the index cards. Your operating system depends on the file system to keep track of where every file and folder lives on the disk, so when that structure gets corrupted, things start breaking in confusing ways. Files disappear, folders become unreadable, and your computer might refuse to boot altogether. But here's the good news: most common file system errors are fixable using built-in tools, and you don't need to be a system administrator to run them safely. This guide will walk you through what these errors actually mean, how to diagnose them, and the step-by-step process to repair your file system without making things worse.

Who Needs This and What Goes Wrong Without It

If you've ever seen a message like "The file or directory is corrupted and unreadable" or watched your external drive suddenly show up as RAW, you're in the right place. These errors affect anyone who uses a computer regularly, but they're especially common for people who: frequently plug and unplug USB drives without safely ejecting, work in areas with unstable power (laptops included), use older hard drives nearing the end of their life, or dual-boot between operating systems that don't share the same file system. Without understanding what's happening and knowing how to fix it, you risk permanent data loss. A corrupted file system can make an entire partition inaccessible, and many people panic and start formatting drives, wiping out everything. Others try random tools from the internet that cause more damage. The worst-case scenario is a drive that worked yesterday but today shows as uninitialized—without the right approach, you could lose years of photos, documents, or project files. Knowing how to properly check and repair a file system is a fundamental skill for anyone who values their data. And it's not just about fixing errors when they happen; it's also about recognizing early warning signs (like unusual slowness or frequent "disk not ejected properly" warnings) before a full crash occurs. In this guide, we'll cover the most common error types—corrupted Master File Table (MFT) on NTFS, bad superblocks on ext4, and directory entry issues on FAT32—and show you how to address each one with confidence.

Who Should Not Attempt DIY Repair

There are some situations where you should stop and call a professional: if you hear clicking sounds from the drive, if the drive is not detected at all in BIOS, or if you've already tried multiple repairs and the errors keep coming back. In those cases, the hardware itself may be failing, and any repair attempt could push the drive over the edge.

Prerequisites and Context to Settle First

Before you run any repair tool, you need to understand a few key concepts. First, file system errors are not the same as bad sectors. A bad sector is a physical defect on the disk surface—the magnetic coating has degraded and that spot can no longer reliably store data. File system errors, on the other hand, are logical mistakes in the data structures that map where files are stored. A repair tool can fix logical errors, but it cannot fix physical damage. Second, you should always have a recent backup before attempting any repair. Yes, the repair tools are generally safe, but if the disk is in a fragile state, the repair process itself can cause further corruption. If you don't have a backup, at least try to copy your most important files to another drive before proceeding—even if some files are unreadable, you might be able to salvage the ones that are still accessible. Third, you need to know what file system your drive uses. On Windows, the most common are NTFS (for internal drives) and FAT32 or exFAT (for removable drives). On macOS, it's APFS or HFS+. On Linux, ext4, XFS, Btrfs, and others. Each file system has its own repair tool: CHKDSK on Windows, Disk Utility First Aid on macOS, and fsck on Linux. Running the wrong tool on the wrong file system can cause more harm than good. Also, be aware that you might need to boot from a recovery environment if the drive contains your operating system—you can't repair the system drive while Windows is running because the file system is in use. We'll cover how to do that later. Finally, understand that repair tools work in two phases: a read-only check that reports errors, and a repair pass that actually makes changes. Always run the check first so you know what you're dealing with.

When to Use Live USB or Recovery Media

If your computer won't boot due to file system corruption, you'll need to boot from a separate system. For Windows, use a Windows installation USB and choose "Repair your computer." For macOS, boot into Recovery Mode (Cmd+R at startup). For Linux, use a live USB distribution. These environments let you access and repair the system drive without it being mounted by the running OS.

Core Workflow: Step-by-Step Repair Process

Now we get to the actual repair steps. The workflow is essentially the same across platforms, but the commands differ. We'll cover each major OS. Start by identifying the drive that's having problems. In Windows, open Disk Management (right-click Start > Disk Management) and look for a drive that shows as RAW or has a file system label like "Unknown." In macOS, open Disk Utility and look for a drive that appears grayed out or shows errors. In Linux, use lsblk or fdisk -l to list drives. Once you know the drive letter or device name (e.g., D: for Windows, /dev/sdb1 for Linux), you can proceed.

Windows: Using CHKDSK

Open Command Prompt as Administrator (right-click Start > Windows Terminal (Admin) or Command Prompt (Admin)). Run: chkdsk D: /f (replace D: with your drive letter). The /f flag tells CHKDSK to fix errors. If you want to also check for bad sectors and recover readable information, add /r: chkdsk D: /f /r. This takes longer but is more thorough. CHKDSK will scan the file system, report any errors, and attempt to fix them. If the drive is your system drive (C:), you'll be prompted to schedule the scan for the next reboot—say yes and restart. After the scan, you can view the results in the Event Viewer under Windows Logs > Application, looking for Wininit events. For external drives, make sure no programs are using the drive before scanning.

macOS: Disk Utility First Aid

Open Disk Utility (Applications > Utilities > Disk Utility). Select the volume you want to repair from the sidebar. Click the First Aid button, then Run. Disk Utility will check the volume for errors and repair them if possible. If the volume is your system volume, you'll need to boot into Recovery Mode: restart and hold Cmd+R until the Apple logo appears, then open Disk Utility from the Recovery menu. Note that Disk Utility can't fix all types of corruption—for deeper issues, you might need to use the command-line fsck_apfs or fsck_hfs tool, but that's beyond the scope of this beginner guide.

Linux: Using fsck

First, unmount the drive: sudo umount /dev/sdb1 (replace with your device). Then run: sudo fsck /dev/sdb1. fsck will check the file system and prompt you before each repair (you can use -y to automatically answer yes). For ext4 file systems, you can also use sudo fsck.ext4 -f /dev/sdb1. If the drive is the root partition, you'll need to boot from a live USB, mount the root partition (if needed), and run fsck on the unmounted device. Some distributions also offer a built-in repair option at boot via the GRUB menu (Advanced options > File system check).

Tools, Setup, and Environment Realities

The built-in tools we just covered are your first line of defense, but they're not the only option. Third-party tools like TestDisk (open-source, works on all platforms) can recover partition tables and rebuild boot sectors if the built-in tools fail. There's also EaseUS Partition Master and MiniTool Partition Wizard for Windows, which offer GUI-based repair options. However, we recommend starting with the free built-in tools before spending money on commercial software. One important reality: these tools work best when the file system corruption is limited. If the drive has extensive physical damage, repair attempts may cause more problems by trying to read bad sectors repeatedly. Also, note that CHKDSK on large drives (over 2TB) can take many hours to complete. Plan accordingly—don't start a repair when you need the computer in 30 minutes. For external drives, use a powered USB hub if the drive is bus-powered to avoid disconnections during the scan. A sudden disconnection mid-repair can corrupt the file system further. Finally, be aware of the trade-off between quick and thorough scans. A quick scan (CHKDSK without /r) only checks file system metadata, while a thorough scan (with /r) reads every sector. If you suspect bad sectors, go for the thorough scan, but be prepared for a long wait.

Comparison of Built-in Tools vs Third-Party

ToolPlatformCostBest For
CHKDSKWindowsFree (built-in)Simple NTFS errors, bad sector detection
Disk Utility First AidmacOSFree (built-in)APFS/HFS+ volume repair
fsckLinuxFree (built-in)ext4, XFS, etc.
TestDiskAllFree (open-source)Partition table recovery, deeper repair
EaseUS Partition MasterWindowsPaid (free version limited)GUI-based repair, partition recovery

Variations for Different Constraints

Not every file system error fits the same mold. Here are common variations and how to adjust your approach.

Corrupted Partition Table vs File System Metadata

If the drive shows as "Unallocated" or "Unknown" in Disk Management, the partition table is damaged, not just the file system. In that case, run CHKDSK won't help because Windows can't see a file system at all. You'll need a tool like TestDisk to rebuild the partition table. This is a more advanced procedure, but TestDisk has a guided mode. The key difference: partition table errors affect the entire drive, while file system errors affect a specific partition.

FAT32 vs NTFS vs exFAT

FAT32 is older and more fragile—it lacks journaling, so corruption is more common. CHKDSK works on FAT32, but the repair options are limited. exFAT is more robust but still lacks journaling. NTFS (Windows) and APFS (macOS) have journaling, which helps recover from crashes but can still get corrupted if the journal itself is damaged. For FAT32/exFAT, always use safe ejection—unplugging without ejecting is the number one cause of corruption.

SSD vs HDD

SSDs handle file system errors differently because they use wear-leveling and TRIM. A corrupted file system on an SSD might be a sign of a failing controller or NAND flash, not just logical errors. Running a thorough scan (CHKDSK /r) on an SSD can cause unnecessary writes and potentially shorten its life. For SSDs, prefer a quick scan first, and if errors persist, consider using the manufacturer's diagnostic tool. HDDs are more forgiving of thorough scans, but the risk of physical damage during a long scan is real if the drive has bad sectors.

Pitfalls, Debugging, and What to Check When It Fails

Sometimes the repair tool runs without errors, but the problem persists. Here are common pitfalls and how to debug them.

The Repair Completed but Files Are Still Missing

CHKDSK may move corrupted files to a hidden folder called found.000 on the root of the drive. These are recovered fragments with .chk extensions. You can try to rename them to the proper extension and open them, but often they're incomplete. This is a salvage operation, not a clean fix.

Drive Still Shows as RAW After Repair

If CHKDSK reports "The type of the file system is RAW" and refuses to run, the partition table may be damaged. Try TestDisk to recover the partition. Alternatively, the drive may have failed completely—check S.M.A.R.T. status using tools like CrystalDiskInfo (Windows) or smartctl (Linux). S.M.A.R.T. attributes like Reallocated Sector Count or Current Pending Sector Count can indicate imminent hardware failure.

Repair Tool Hangs or Takes Forever

If CHKDSK or fsck freezes on a particular stage (like "Stage 4: Looking for bad clusters"), the drive may have a physical bad sector that the tool is struggling to read. Let it run for a while (hours), but if it's stuck for more than 12 hours, force quit and try a different approach: clone the drive with ddrescue first, then run the repair on the clone. This avoids stressing the failing hardware.

Accidentally Interrupted a Repair

If the power goes out or you reboot during a repair, the file system may be left in an inconsistent state. Run the repair again—it should pick up where it left off or undo partial changes. If the drive becomes unbootable, boot from recovery media and run the repair again.

Frequently Asked Questions and Common Mistakes

Can I use CHKDSK on a USB flash drive? Yes, but flash drives have limited write cycles, so prefer a quick scan without /r unless necessary. Also, many flash drives come preformatted as FAT32, and CHKDSK works fine on that.

What's the difference between /f and /r in CHKDSK? /f fixes file system errors; /r also locates bad sectors and recovers readable information. /r implies /f. Use /f for quick checks, /r for thorough checks if you suspect physical damage.

My Mac says "First Aid found corruption but can't repair it." What now? This often means the corruption is severe. Try booting into Recovery Mode and running First Aid from there. If that fails, you may need to reformat and restore from backup, or use a third-party tool like DiskWarrior.

Should I defragment after a repair? No. Defragmenting is for HDDs only, and it's unnecessary after a file system repair. On modern systems, defragmentation is automatic (Windows) or not needed (SSD).

Can a file system error be caused by a virus? Yes, some malware deliberately corrupts file system structures. Always run a virus scan after repairing, especially if you didn't cause the corruption through a crash or improper shutdown.

Common Mistakes to Avoid

One of the most frequent mistakes is running CHKDSK on a drive that's still in use by another program—this can cause the tool to report false errors or fail to fix real ones. Always close all programs that might access the drive, including antivirus scans and file explorers. Another mistake is assuming that a successful repair means the drive is healthy. If the repair found errors, the drive might be failing. Back up your data immediately after a repair, even if everything looks fine. Lastly, don't use third-party repair tools that claim to "fix all errors automatically" without reading reviews—some of them do more harm than good by overwriting critical structures.

What to Do Next: Specific Actions After Repair

After you've successfully repaired the file system, take these steps to prevent future issues. First, immediately back up your important data to a different drive. The fact that you had errors means the drive is at higher risk for future corruption. Use a backup strategy like the 3-2-1 rule (three copies, two different media, one offsite). Second, check the drive's health using S.M.A.R.T. monitoring. On Windows, use CrystalDiskInfo or the built-in WMIC command: wmic diskdrive get status. On macOS, use System Information > Storage > S.M.A.R.T. Status. On Linux, use sudo smartctl -a /dev/sda. If the status is not "Verified" or "Good," consider replacing the drive. Third, update your operating system and drivers—sometimes file system bugs are fixed in updates. Fourth, adjust your habits: always safely eject external drives, use a UPS for desktop computers, and avoid force-shutting down your computer. Finally, consider scheduling regular file system checks. On Windows, you can schedule CHKDSK at boot using chkntfs C: to check on next restart. On Linux, fsck runs automatically every few mounts. On macOS, Disk Utility can be run manually every month. These preventive steps will catch errors early, before they cause data loss. Remember, file system errors are a symptom, not the disease—if you keep seeing them, the underlying hardware or usage pattern needs to change.

Share this article:

Comments (0)

No comments yet. Be the first to comment!