4

I have been trying to get a FreeBSD box (running FreeNAS) to control its fans. It wants to just run them at high speed even though the system temperatures are quite low. The lm-sensors package can do this on Linux, but it's not available on FreeBSD.

I found this similar question here, but there has been no response.

Is there a kernel module I can load to do this on FreeBSD?

3

ACPI

Yes. If your hardware supports Advanced Configuration and Power Interface (ACPI) then there are loadable modules for ACPI support.

Unfortunately most (if not all) modules are targetting laptops.

You can see if you have any settings related to fans using sysctl:

# sysctl hw.acpi

But rather than manually tweaking the fan speed it should autoadjust according to temperature and load. In FreeBSD this is handled by powerd which is disabled by default.

So even if the fans are not directly exposed then you might be able to adjust them but adjusting the CPU frequency. Some BIOSes then adjust the fan speed accordingly (if within reasonable temperature range as well).

Example setting in /etc/rc.conf

powerd_enable="YES"
powerd_flags="-a adaptive"
performance_cx_lowest="C2"      # Online CPU idle state
performance_cpu_freq="1399"     # Online CPU frequency
economy_cx_lowest="C3"          # Offline CPU idle state
economy_cpu_freq="NONE"         # Offline CPU frequency

The sysctl hw.acpi will also show if any of the above settings can take effect.

IPMI

If you have no luck going the ACPI route then maybe the Intelligent Platform Management Interface (IPMI) can be helpful to you. This is however normally only available on serverclass motherboards with a BMC.

When the server boots up the fans runs at BIOS default speeds until the OS takes over. If the OS does not take over (ie. using ACPI) then the CPU and fans often runs at full throttle. Even though the thresholds are not directly available in the BIOS configuration screen in several cases this can then be set using IPMI.

FreeBSD does have an IPMI driver and you can install sysutils/ipmitool to play with the settings.

The following snippet from servethehome.com should work for some SuperMicro boards (X9/X10/X11):

#set fan mode to "full"
ipmitool raw 0x30 0x45 0x01 0x01
#set fans in "system" zone to 37.5%
ipmitool raw 0x30 0x70 0x66 0x01 0x00 0x24
#set fans in "peripheral" zone to 25%
ipmitool raw 0x30 0x70 0x66 0x01 0x01 0x16

NOTE: The fan mode is set to full at first as the BMC does not seem to change the fan speed if not.

Hardware

If everything else fails then get a cheap hardware fan controller :-).

  • This is a server class motherboard (Tyan dual processors), but the impitool raw command fails with "Unable to send RAW command (channel=0x0 netfn=0x30 lun=0x0 cmd=0x45 rsp=0xc1): Invalid command" . I tried the powerd setting but that didn't help. I think this is just what i get for buying a cheap server on ebay. – dwilliss Sep 22 '17 at 17:20
  • Having gotten no more answers, I'm going to mark this one as the answer. It didn't work for me because the motherboard just doesn't support it. But it will hopefully help others. – dwilliss Oct 4 '17 at 22:36
0

It sounds what you are looking at is the result of a different BMC being used in the X9 vs. X10/X11. The X9 can only issue raw commands to change fan mode - a 4 value string (as summarized below); whereas the X10/11 boards can take a 6 value string to control additionally fan zone and duty cycle.

# Set fan mode: raw 0x30 0x45 0x01 [x]
# [x] Modes:      CPU Zone  Peripheral Zone
#                 Target    Target 
# -------------   --------  ---------------
# 00  Standard    50%      50%
# 01  Full        100%     100%
# 02  Optimal     30%      30%
# 04  Heavy I/O   50%      75%
0

Traditional fan control is generally not supported on any BSD systems. FreeBSD 12 (2019) doesn't have a sensors framework, and even though NetBSD and OpenBSD both do, they don't support fan control on it, either. Linux does support fan control with lm-sensors, as you point out, but, indeed, it's not available on the BSDs.

As mentioned in the other answers, you could try ipmitool if you have server-grade software with IPMI.

Else, realistically, the best course of action might be to see if BIOS has an option for fan control. Another hack is to configure the chip with another operating system, then warm-reboot back into FreeBSD, hoping that the settings don't get reset in the meantime. Finally, you could also try hacking a solution yourself; in fact, this is what I've done with my fan control patchset for OpenBSD/DragonFly when I wanted to quiet down my server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.