This is an updated cross-post from a month old email I sent to the debian-user 
list (here: https://lists.debian.org/debian-user/2018/10/msg00391.html ) but 
this is probably where I should have asked in the first place. I'm trying to 
find a work-around for the following bug: 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838503
Package installs during imaging of a new Stretch host with a simple raid1 
system disk takes ~2000 seconds. The packages installs on an equivalent Jessie 
install take ~300 seconds. This may not be much of an issue for isolated host 
installs, but I’m looking to speed up and automate the process to facilitate 
bulk imaging.
I've found that when imaging a Stretch host, if I console in and `echo 1000 > 
/proc/sys/dev/raid/speed_limit_max` I can throttle the raid sync and greatly 
speed up package installs. But I have thus far only been able to do this 
manually. I'm trying to find a way of setting this value early enough in 
preseed that it applies throughout the bulk of the package installs. So far 
I’ve attempted the following approaches (and more) without success:

  *   d-i preseed/early_command   string  echo "dev.raid.speed_limit_max = 
1000" >> /etc/sysctl.conf
     *   No /etc/sysctl.conf file is found when I console in to check
  *   d-i preseed/include_command   string echo 1000 > 
/proc/sys/dev/raid/speed_limit_max
     *   When I check on the value after the command should have run, it is 
still the default of “200000”
     *   Yields an error: ‘ /var/lib/dpkg/info/network-preseed.postinst: eval: 
line 1: can't create /proc/sys/dev/raid/speed_limit_max: nonexistent directory’
  *   d-i preseed/include_command   string  echo "dev.raid.speed_limit_max = 
1000" >> /etc/sysctl.conf
     *   /etc/sysctl.conf is created but the value is ignored.
  *   d-i preseed/late_command   string  echo 1000 > 
/proc/sys/dev/raid/speed_limit_max
     *   When I check on the value after the command should have run, it is 
still the default of “200000” and is too late in the process to matter.
  *   I can set the value through a late_script, but that runs well after most 
of the packages have already installed.
  *   The command sysctl doesn’t seem to exist for this version of BusyBox 
(BusyBox v1.22.1).
  *   I wrote a script (echoed into /tmp) meant to essentially brute-force the 
kernel parameter, to be run via ‘partman/run’. After some testing I saw that in 
stretch the script was not found while in jessie and wheezy it was.  What 
changed in stretch?

Can anyone provide recommendations for the appropriate method for setting this 
kernel parameter during preseed at a point early enough to be useful?

Reply via email to