Initial configuration

Boot loader configuration

by ross at 13:13:50 on January 28, 2014

/boot/loader.conf is used to tweak boot options, load kernel modules and set read-only kernel tunables (read-write kernel variables could be set with sysctl and /etc/sysctl.conf).

An example of /boot/loader.conf:


# Uncomment if you use (and boot from) zfs,
# replace "system" with the pool name, i.e. zroot, tank

# zfs arc size:

# Uncomment if you use gmirror

# Uncomment if you use gstripe

kern.maxusers controls the scaling of a number of static system tables, including defaults for the maximum number of open files, sizing of network memory resources, etc.

kern.maxusers is automatically sized at boot based on the amount of memory available in the system. We will set it even higher here.

If you use ZFS you might want to limit ARC size otherwise ZFS will eat all the memory (controlled by vfs.zfs.arc_max). An alternative approach is to set vm.kmem_size and vm.kmem_size_max which limit memory available to the kernel.


See loader.conf(7) and /boot/defaults/loader.conf.