如何控制风扇速度?

如何控制计算机的风扇速度?

在Windows上有一个名为SpeedFan的精彩程序。

开始前请注意:

此function取决于您的硬件和软件。 如果您的硬件不支持风扇速度控制,或者未向操作系统显示它们,则很可能您无法使用此解决方案。 如果确实如此,但软件(又称内核)不知道如何控制它,你就没有运气了。


  1. 安装lm-sensors和fancontrol包。
  2. 配置lm传感器

    1. 在终端类型sudo sensors-detect并回答所有是/否问题的是。
    2. 在传感器检测结束时,将显示需要加载的模块列表。 键入“yes”以使传感器检测将这些模块插入/ etc / modules,或自行编辑/ etc / modules。
    3. 运行sudo service module-init-tools restart 。 这将读取您在步骤3中对/etc/modules所做的更改,并将新模块插入到内核中。
      • 注意 :如果您运行的是Ubuntu 13.04或更高版本,则应将第3步命令替换为sudo service kmod start
  3. 配置fancontrol

    1. 在终端类型sudo pwmconfig 。 此脚本将停止每个风扇5秒钟,以找出哪个风扇可由哪个PWM手柄控制。 脚本循环遍历所有风扇后,您可以配置哪个风扇对应于哪个温度。
    2. 您必须指定要使用的传感器。 这有点棘手。 如果您只有一个风扇,请确保为您的核心使用温度传感器以使风扇控制速度为基础。
    3. 运行提示并将更改保存到默认位置。
    4. 进行调整以微调/etc/fancontrol并使用sudo service fancontrol restart来应用您的更改。 (在我的情况下,我将间隔设置为2秒。)
  4. 设置fancontrol服务

    1. 运行sudo service fancontrol start 。 这也将使fancontrol服务在系统启动时自动运行。

在我的情况下/etc/fancontrol用于我使用的CPU:

 Settings for hwmon0/device/pwm2: Depends on hwmon0/device/temp2_input Controls hwmon0/device/fan2_input MINTEMP=40 MAXTEMP=60 MINSTART=150 MINSTOP=0 MINPWM=0 MAXPWM=255 

如果您拥有一台ThinkPad ,那么有一款名为thinkfan的软件正是如此。 顾名思义显然,它是专为ThinkPad( thinkpad_acpi )制作的。

thinkfan软件在标准的ubuntu软件存储库中可用,但它需要几个步骤来配置。

这是一个简单的分步指南:

http://staff.science.uva.nl/~kholshei/thinkfan_guide/

(这基本上是这个德国指南的翻译版本: http : //thinkwiki.de/Thinkfan )


邮政相关资料:

步骤1.安装thinkfan软件和传感器:

 sudo apt-get install thinkfan lm-sensors 

步骤2.通过编辑thinkpad.conf文件,确保守护程序控制风扇:

 sudo nano /etc/modprobe.d/thinkfan.conf 

通过添加以下行:

 options thinkpad_acpi fan_control=1 

步骤3.通过编辑文件在启动时自动加载守护程序:

 sudo nano /etc/default/thinkfan 

确保START键设置为yes,即应该有一行说明:

 START=yes 

步骤4.检测笔记本电脑的传感器:

 sudo sensors-detect 

只需在按Enter键提示时选择默认答案。

步骤5.加载新模块。 从ubuntu 13.10开始,这完成了:

 sudo service kmod start 

而对于像13.04这样的先前版本,你需要做的是:

 sudo service module-init-tools start 

步骤6.找出正在使用的传感器:

 sensors 

(表示0度的那些没有被使用,我不知道为什么那些被“检测到”)。 记住哪些正在使用中。

步骤7.找出这些传感器的完整路径:

 find /sys/devices -type f -name "temp*_input" 

输出应该是/ sys / devices / …之类的路径列表

步骤8.将传感器的路径复制粘贴到配置文件/etc/thinkpad.conf中。 为此,首先打开文件:

 sudo nano /etc/thinkfan.conf 

应该已经有一条线了

 #sensor /proc/acpi/ibm/thermal (0, 10, 15, 2, 10, 5, 0, 3, 0, 3) 

(#-symbol表示该行被注释掉)。 添加以sensor开头的行(不带#-symbol)并复制粘贴第一个传感器。 如果您有多个传感器,请重复此步骤。 例如,在我的机器上,步骤7中的输出结果

 /sys/devices/virtual/hwmon/hwmon0/temp1_input /sys/devices/platform/thinkpad_hwmon/temp3_input /sys/devices/platform/thinkpad_hwmon/temp4_input /sys/devices/platform/thinkpad_hwmon/temp5_input /sys/devices/platform/thinkpad_hwmon/temp6_input /sys/devices/platform/thinkpad_hwmon/temp7_input /sys/devices/platform/thinkpad_hwmon/temp1_input /sys/devices/platform/thinkpad_hwmon/temp8_input /sys/devices/platform/thinkpad_hwmon/temp2_input /sys/devices/platform/coretemp.0/temp4_input /sys/devices/platform/coretemp.0/temp2_input 

在我的机器中使用的是第一行和最后两行中的那些,所以我添加了三行:

 sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input sensor /sys/devices/platform/coretemp.0/temp4_input sensor /sys/devices/platform/coretemp.0/temp2_input 

步骤9.最后,我们可以在配置文件中设置风扇速度级别。 如果/etc/thinkpad.conf文件尚未打开,请打开它。

 sudo nano /etc/thinkfan.conf 

我在ThinkPad x201上使用的风扇级别是:

 (0, 0, 51) (1, 50, 52) (2, 51, 55) (3, 54, 58) (4, 56, 63) (5, 60, 70) (6, 66, 79) (7, 74, 92) (127, 85, 32767) 

最后一行确保完全风扇速度(127 =“脱离”即未调节)。 您可以调整这些级别以满足您的需求/愿望,但请小心!

步骤10.重新启动。 现在一切都应该有效。 为了检查thinkpad是否正确运行,请使用

 sudo thinkfan -n 

以详细模式启动thinkfan。 您可能希望首先停止thinkfan守护程序:

 sudo /etc/init.d/thinkfan stop 

如果要再次启动thinkfan守护程序,请键入:

 sudo /etc/init.d/thinkfan start 

为了完成,我的/etc/thinkfan.conf配置文件是:

 # IMPORTANT: # # To keep your HD from overheating, you have to specify a correction value for # the sensor that has the HD's temperature. You need to do this because # thinkfan uses only the highest temperature it can find in the system, and # that'll most likely never be your HD, as most HDs are already out of spec # when they reach 55 °C. # Correction values are applied from left to right in the same order as the # temperatures are read from the file. # # For example: # sensor /proc/acpi/ibm/thermal (0, 0, 10) # will add a fixed value of 10 °C the 3rd value read from that file. Check out # http://www.thinkwiki.org/wiki/Thermal_Sensors to find out how much you may # want to add to certain temperatures. # Syntax: # (LEVEL, LOW, HIGH) # LEVEL is the fan level to use (0-7 with thinkpad_acpi) # LOW is the temperature at which to step down to the previous level # HIGH is the temperature at which to step up to the next level # All numbers are integers. # # I use this on my T61p: #sensor /proc/acpi/ibm/thermal (0, 10, 15, 2, 10, 5, 0, 3, 0, 3) #(0, 0, 55) #(1, 48, 60) #(2, 50, 61) #(3, 52, 63) #(4, 56, 65) #(5, 59, 66) #(7, 63, 32767) # My settings for my ThinkPad X201: (kris) sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input sensor /sys/devices/platform/coretemp.0/temp4_input sensor /sys/devices/platform/coretemp.0/temp2_input (0, 0, 51) (1, 50, 52) (2, 51, 55) (3, 54, 58) (4, 56, 63) (5, 60, 70) (6, 66, 79) (7, 74, 92) (127, 85, 32767) 

对于多台Dell计算机,您可以安装i8kutils软件包:

 sudo apt install i8kutils 

如果您有未经测试的戴尔(例如我的戴尔XPS 14z),您可能必须强制加载内核模块:

 sudo modprobe i8k force=1 

安装和配置lm-sensors和fancontrol包:

 sudo apt-get install lm-sensors fancontrol 

有关配置它们的文档,请参见其手册页。

这是一个应该由ACPI兼容的BIOS提供的function,但似乎大多数主板供应商都不愿意遵循该标准。