When a FreeBSD-based system boots, loader.conf(5) is read to determine if any parameters should be passed to the kernel or if any additional kernel modules (such as drivers) should be loaded. Since loader values are specific to the kernel parameter or driver to be loaded, descriptions can be found in the man page for the specified driver and in many sections of the FreeBSD Handbook.
FreeNAS® provides a graphical interface for managing loader values. This advanced functionality is intended to make it easier to load additional kernel modules at boot time. A typical usage would be to load a FreeBSD hardware driver that does not automatically load after a FreeNAS® installation. The default FreeNAS® image does not load every possible hardware driver. This is a necessary evil as some drivers conflict with one another or cause stability issues, some are rarely used, and some drivers just don't belong on a standard NAS system. If you need a driver that is not automatically loaded, create a tunable.
DANGER! adding a tunable is an advanced feature that could adversely effect the ability of the FreeNAS® system to successfully boot. It is very important that you do not have a typo when adding a tunable as this could halt the boot process. Fixing this problem requires physical access to the FreeNAS® system and knowledge of how to use the boot loader prompt as described in Recovering From Incorrect Tunables. This means that you should always test the impact of any changes on a test system first.
To add a tunable, go to System → Tunables → Add Tunable, as seen in Figure 4.9a.
Figure 4.9a: Adding a Tunable
Table 4.9a summarizes the options when adding a tunable.
Table 4.9a: Adding a Tunable
|Variable||string||typically the name of the driver to load, as indicated by its man page|
|Value||integer or string||value to associate with variable; typically this is set to YES to enable the driver specified by the variable|
|Comment||string||optional, but a useful reminder for the reason behind adding this tunable|
|Enabled||checkbox||uncheck if you would like to disable the tunable without deleting it|
The changes you make will not take effect until the system is rebooted as loader settings are only read when the kernel is loaded at boot time. As long as the tunable exists, your changes will persist at each boot and across upgrades.
Any tunables that you add will be listed alphabetically in System → Tunables → View Tunable. To change the value of a tunable, click its Edit button. To remove a tunable, click its Delete button.
At this time, the GUI does not display the tunables that are pre-set in the installation image. FreeNAS® 8.3.0 ships with the following tunables set:
autoboot_delay="2" loader_logo="freenas" kern.cam.boot_delay=30000 fuse_load="YES" geom_mirror_load="YES" geom_stripe_load="YES" geom_raid3_load="YES" geom_raid5_load="YES" geom_gate_load="YES" geom_multipath_load=”YES” debug.debugger_on_panic=1 hw.hptrr.attach_generic=0 kern.ipc.nmbclusters="262144"
Do not add or edit the default tunables as doing so will overwrite the default values which may render the system unusable.
Recovering From Incorrect Tunables
If a tunable is preventing the system from booting, you will need physical access to the FreeNAS® system. Watch the boot messages and press the number 6 key to select "6. Escape to loader prompt" when you see the FreeNAS® boot menu shown in Figure 4.9b.
Figure 4.9b: FreeNAS® Boot Menu
The boot loader prompt provides a minimal set of commands described in loader(8). Once at the prompt, use the unset command to disable a problematic value, the set command to modify the problematic value, or the unload command to prevent the problematic driver from loading.
Example 4.9a demonstrates several examples using these commands at the boot loader prompt. The first command disables the current value associated with the kern.ipc.nmbclusters MIB and will fail with a "no such file or directory" error message if a current tunable does not exist to set this value. The second command disables ACPI. The third command instructs the system not to load the fuse driver. When finished, type boot to continue the boot process.
Example 4.9a: Sample Commands at the Boot Loader Prompt
Type '?' for a list of commands, 'help' for more detailed help. OK unset kern.ipc.nmbclusters OK set hint.acpi.0.disabled=1 OK unload fuse OK boot
Any changes made at the boot loader prompt only effect the current boot. This means that you need to edit or remove the problematic tunable in System → Tunables → View Tunables to make your change permanent and to prevent future boot errors.