Linux Boot Configuration

In no way intended to be a complete list - but as I come up with boot-time config needs that I don't know already I'll try to add notes on them here.

IO Scheduler

The IO Scheduler can be set at run-time very easily through sysfs - for example:

example:~# cat /sys/block/sda/queue/scheduler 
noop anticipatory [deadline] cfq 
example:~# echo cfq > /sys/block/sda/queue/scheduler
example:~# cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq] 

See also: http://www.kernel.org/doc/Documentation/block/switching-sched.txt

Details on the various schedulers can be read here: I/O_scheduling

Unfortunately I've not found a way to set a per-device IO scheduler at boot time - though it would be simple enough to script up pseudo-service or @reboot cron job to do this.

It's possible to set a kernel default sheduler by adding the "elevator=<scheduler>" option to the kernel parameter in your boot loader. For example - setting the deadline scheduler as default in grub2 (/boot/grub/menu.lst):

title           Debian GNU/Linux, kernel 2.6.26-2-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 ro quiet elevator=deadline
initrd          /boot/initrd.img-2.6.26-2-686

/proc/sys/... settings

As per various comments in LinuxMemoryManagement it's sometimes desirable to change the default configuration of a value that appears under /proc/sys

/proc/sys/ replaces the deprecated sysctl system, but changes for boot time are still placed in the old-style in /etc/sysctl.conf.

For example - setting /proc/sys/vm/dirty_background_ratio at boot time is done by adding this to /etc/sysctl.conf:

vm.dirty_background_ratio = 2

BradsWiki: LinuxBootConfiguration (last edited 2012-01-12 11:55:07 by BradleyDean)