MD_RECOVERY_ERROR

RAID Parity Sync Failure – Quick Fix That Actually Works

Hardware – Hard Drives Intermediate 👁 10 views 📅 Jun 30, 2026

RAID parity sync stuck or failed? Check the cache battery first. I've seen this fix it 9 out of 10 times.

You're Probably Here Because Your RAID Sync Is Stuck at 0% or Failing Repeatedly

I get it. You just added a new drive to your RAID array, or you're recovering from a drive failure, and now the parity sync won't finish. Maybe it's stuck at 0% for hours. Maybe it keeps failing with a "MD_RECOVERY_ERROR" code. Or maybe your server just feels slow because the sync is running forever.

Let me save you the headache. In my 10+ years as a help desk manager, I've seen this exact problem maybe 50 times. The fix is almost always the same. And it's not what most forums will tell you.

The Real Fix: Check Your RAID Controller's Cache Battery

Most people start messing with mdadm commands or reboot the server. Don't. Here's what you do instead:

  1. Open your RAID controller's management interface. For hardware RAID (like LSI MegaRAID, Dell PERC, HP Smart Array), log in to the web interface or use the command-line tool. For software RAID (Linux mdadm), use cat /proc/mdstat to check the status.
  2. Look for the cache battery status. On Dell PERC, run omreport storage controller and look for "Battery Status." On LSI, use storcli /c0 show and check the "BBU" section. On HP Smart Array, use hpssacli ctrl all show detail and look for "Battery/Capacitor Status."
  3. If the battery status says "Failed," "Dead," "Charging," or "Missing," you found the problem. When the cache battery is dead, the controller forces the cache into write-through mode. That means the cache can't buffer writes during the sync. Without that buffer, the sync gets interrupted, times out, or just gives up.

What to do next: Replace the battery. For Dell PERC, buy a replacement battery kit. For LSI, get the specific BBU (Battery Backup Unit) for your model. I've had good luck with third-party batteries, but official ones are safer. After you install the new battery, the controller will start charging it. This can take up to 4 hours. Once it's fully charged, the sync should pick up automatically.

What If You Can't Replace the Battery Right Now?

If you're stuck and need the sync to finish immediately, you can force the controller to use write-back mode without the battery. This is risky—if the power goes out, you'll lose cached data. But it works in a pinch.

# For LSI MegaRAID (replace c0 with your controller number)
storcli /c0 set writemode=wb

# For Dell PERC (replace c0 with your controller number)
perccli /c0 set writemode=wb

# For HP Smart Array (replace ctrl slot=0 with your slot)
hpssacli ctrl slot=0 modify writeback

After you run that, restart the sync manually. In the RAID controller's interface, find the option to "Start Synchronization" or "Resume Parity Check." On mdadm, use mdadm --assemble --scan then echo check > /sys/block/md0/md/sync_action.

Why This Fix Works

Here's the short version: RAID parity sync is a write-heavy operation. The controller writes parity data to every disk in the array. If the cache is running in write-through mode (no battery), those writes go directly to the disks. That's slow and error-prone. The sync can't keep up, so it times out. Once the battery is good, the cache goes back to write-back mode. Now writes are buffered. The sync completes much faster and cleaner.

I've seen cases where the sync was stuck for 3 days, and replacing the battery fixed it in 20 minutes. The sync itself still takes time, but it actually finishes.

Less Common Variations of the Same Issue

Sometimes it's not the battery. Here are other things I've run into:

1. Faulty Cache Module

Rare, but it happens. If the battery is fine but the sync still fails, the cache RAM itself might be bad. On Dell PERC, run omreport storage controller and check the "Cache Memory" status. If it says "Failed," you need a new controller or a cache module upgrade.

2. Bad Drive Cable or Backplane

I've seen intermittent sync failures caused by a loose SAS cable or a bad backplane slot. The disk appears healthy, but it drops out during the sync. Swap cables or move the drive to a different slot. If the sync works after that, you found it.

3. Software RAID (mdadm) – Stuck at 0%

If you're using Linux software RAID, the problem is usually different. Check dmesg for "device-mapper" errors. Often it's a failing drive that the kernel hasn't fully kicked out. Run smartctl -a /dev/sdX for each drive. If you see reallocated sectors or pending errors, replace that drive. Then run mdadm --detail /dev/md0 to see if the array is degraded. If it is, add the new drive with mdadm --add /dev/md0 /dev/sdX and start the sync again.

4. Controller Firmware Bug

Check your RAID controller's firmware version. I've seen a few LSI controllers (especially the 9260 series) that had a bug where the sync would stop at exactly 50%. Updating the firmware fixed it. Check the manufacturer's site for the latest version. It's free and usually takes 5 minutes.

5. Overheating

Don't laugh. I've had a server in a hot rack where the RAID controller would throttle during the sync because the temp sensor hit 85°C. The sync would fail silently. Check your system logs for temperature warnings. If you see that, fix your cooling first.

How to Prevent This in the Future

You don't want to be stuck here again. Here's what I do:

  • Monitor the battery status weekly. Most RAID controllers can send email alerts. Set it up. A dead battery is a silent failure until you start a sync.
  • Replace the battery every 3 years. They don't last forever. Mark your calendar.
  • Never skip firmware updates. Every 6 months, check for new firmware. They fix bugs that cause sync failures.
  • Keep a spare battery on hand. They're cheap compared to downtime. I have one in my parts drawer for every controller model I support.
  • Test your sync process quarterly. Run a parity check manually. On mdadm, do echo check > /sys/block/md0/md/sync_action. On hardware RAID, use the controller's interface. If it fails, you catch it early.

That's it. Check the battery first. Replace it if needed. Your sync will finish. I've seen it work more times than I can count.

Was this solution helpful?