I have a 2 disk MD raid1 array. One of the drives is slow so I want to replace it. But for paranoia[1] and safety's sake, I want to add the new (3rd) drive and sync it before removing the slow drive, since, well, it's just slow, but otherwise is working and has valid data on it and I want to avoid degrading the array before I have to.
So I've added the third disk and it's started syncing, so all is good so far. But it's only using 1 of the existing 2 drives as the source of the sync, and wouldn't you know it according to what I call the 50/50/90 rule[2], it's using the slow disk as the (only) source of the sync. I can see that it's (only) using the slow disk using sar:
01:21:55 PM tps rkB/s wkB/s dkB/s areq-sz aqu-sz await %util DEV
01:22:00 PM 91.60 0.00 45147.30 0.00 492.87 0.14 1.48 11.26 sdb
01:22:00 PM 0.40 0.00 1.70 0.00 4.25 0.13 314.00 48.08 sde
01:22:00 PM 91.60 45145.60 1.70 0.00 492.87 3.41 37.26 88.30 sdd
01:22:00 PM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 md0
sdd
is the slow disk. If MD were reading from sde
instead, the speed would be about 4x that:
# dd if=/dev/sde of=/dev/null bs=1M count=5000
5000+0 records in
5000+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 23.1946 s, 226 MB/s
Frankly I am surprised that MD is being that simplistic and that it doesn't read from all of the disks when rebuilding, for exactly this kind of reason/case.
So, is there any way I can force the use of sde
in this sync, either in addition to sdd
or instead of it?
P.S. The sync speed is not being limited by dev.raid.speed_limit_max
:
# sysctl -n dev.raid.speed_limit_max
20000000
[1] Call me paranoid, but you know the moment that your array is down to a single disk is when that single disk is going fail.
[2] If you have a 50/50 chance of something happening one way or the other, 90% of the time it will be the way you didn't want.