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:

autoboot_delay="3"
kern.maxusers="1024"

# 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"

# zfs arc size:
vfs.zfs.arc_max="1024M"

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

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

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.

 

Comments