Bug#838503: debian-installer: mdadm should not start syncing RAID1 arrays at full speed during installation
On Thu, Dec 06, 2018 at 11:09:01PM +0000, Steve McIntyre wrote:
>[ Responding to this old bug, prompted by discussion in #debian-boot
> tonight ]
>On Sat, Jun 24, 2017 at 09:01:49PM +0200, Cyril Brulebois wrote:
>>Baptiste Jonglez <firstname.lastname@example.org> (2016-09-21):
>>> When creating a RAID1 array in the debian-installer and using it for
>>> the installation, mdadm immediately starts syncing the disks of the
>>> RAID array.
>>> This is a bad idea, because the subsequent install will be really slow
>>> on rotational disks (linear disk access by mdadm and random disk
>>> access by dpkg). On a fairly recent computer with 2 SATA disks, the
>>> installation took around 20 minutes before even arriving to the
>>> tasksel step.
>>Well, I can understand the argument, but the user could very well expect
>>disks to be in mirror mode as soon as possible, and not wait until a few
>>days after the installation before the initial sync ends…
>The number isn't persistent across reboots, so it would speed up again
>on the reboot after the installation finished.
>>> I can see two solutions:
>>> 1) lower the speed of the syncing operation, by setting the
>>> "dev.raid.speed_limit_max" sysctl setting to e.g. 1000;
>>I'm not sure it would be a good idea to stick a hardcoded value there,
>>even if we were to lower the available bandwidth… Too many different
>>cases, be it about actual hardware, disk sizes, etc.
>1000 is a nice small number, which I think might make sense as a
>default *while* we're installing. Once the installer has finished and
>the system is rebooted, all will go back to normal. Hell, we could
>even expose this value via debconf for expert (and preseed) if needed.
So, I've been playing with this some more. For people who care deeply
about this now:
* if you're preseeding your setup, add the following to control RAID
d-i partman/early_command \
string modprobe md_mod; echo 2000 > /proc/sys/dev/raid/speed_limit_max
(this will limit resync speeds to a max of 2000 K/sec)
* if you're running d-i by hand, switch to another console then:
# echo <SPEED> > /sys/block/<MD>/md/sync_speed_max
after you've created your RAID devices
Steve McIntyre, Cambridge, UK. email@example.com
Dance like no one's watching. Encrypt like everyone is.