Initial configuration

Boot loader configuration

by ross at 04:47:03 on October 23, 2017

/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:

# Timeout in boot menu
autoboot_delay="3"

# A reasonable value here. But also see kern.* tunables in sysctl.conf
kern.maxusers="256"

# Uncomment if you use (and boot from) zfs,
# replace "system" with the pool name, i.e. zroot, tank
#zfs_load="YES"
#vfs.root.mountfrom="zfs:system"

# see https://wiki.freebsd.org/ZFSTuningGuide:
vfs.zfs.arc_min="1024M"
vfs.zfs.arc_max="1024M"
vfs.zfs.write_limit_override="256M"
vfs.zfs.txg.timeout="5"
vfs.zfs.prefetch_disable="1"

# Uncomment if you use gmirror
#geom_mirror_load="YES"

# Uncomment if you use gstripe
#geom_stripe_load="YES"

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.

 

Comments