Speeding Up MDADM RAID Rebuilds

Speeding Up MDADM RAID Rebuilds

Speeding Up MDADM RAID Rebuilds I’m slowly migrating a bunch of awesome things from a really old server, it’s still running Ubuntu 10.04.. to a really nice and shiny one. Which has 2 new 3TB HDDs in RAID 1, which are syncing..

<br /> cat /proc/mdstat<br /> md3 : active raid1 sda4[0] sdb4[1]<br /> 1847478528 blocks super 1.2 [2/2] [UU]<br /> [>....................] resync = 0.1% (2061952/1847478528) finish=28857.9min speed=1065K/sec<br />

That’s like 40 days of syncing.. surely we can do better than that? Can’t we speed up this MDADM RAID 1 rebuild?

Speeding Up MDADM RAID Rebuilds

Sure we can, we’re awesome, I’m awesome, you’re awesome, can I get a hell yeah? HELL YEAH!

Likes lots of things that are tuneable, we have to do NASTY things to /proc. This bit sets the minimum speed we want mdadm to go at.

<br /> cat /proc/sys/dev/raid/speed_limit_min<br /> 1000<br />

We’re greedy though and in the words of Tim Tool Time Taylor, MORE POWER. As root..

<br /> echo 50000 > /proc/sys/dev/raid/speed_limit_min<br />

We’ve just made mdadm run FIFTY TIMES faster. FOR FREE. We didn’t even swap out the SATA disks for SAS SSDs, we just changed a number ..

<br /> md3 : active raid1 sda4[0] sdb4[1]<br /> 1847478528 blocks super 1.2 [2/2] [UU]<br /> [=====>...............] resync = 26.0% (480866560/1847478528) finish=141.9min speed=160501K/sec<br />

Now 10 minutes later we’re already over 1/4 the way through, 2 hours left baby. Hell yeah.