Thinkpad笔记本ubuntu风扇设置

If you own a ThinkPad, there's a piece of software called thinkfan that does exactly this. As the name obviously suggests, it is specifically made for ThinkPads (thinkpad_acpi).

The thinkfan software is available in the standard ubuntu software repositories, but it does require a few steps to configure.

Here's an easy step-by-step guide:

http://www.lxle.net/forums/discussion/821/how-to-set-up-thinkfan-on-a-lenovo-thinkpad-t430/p1

(which is basically a translated version of this German guide: Thinkfan – ThinkPad-Wiki)


Relevant Information from Post:

Step 1. Install the thinkfan software and the sensors:

sudo apt-get install thinkfan lm-sensors

Step 2. Make sure that the daemon controls the fan by editting the thinkpad.conf file:

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

by adding the following line:

options thinkpad_acpi fan_control=1

Step 3. Make the daemon load automatically at start-up by editting the file:

sudo nano /etc/default/thinkfan

making sure that the START key is set to yes, i.e. there should be a line that says:

START=yes

Step 4. Detect your laptop's sensors:

sudo sensors-detect

and just choose the default answers whenever you're prompted by hitting Enter.

Step 5. Load the new modules. From ubuntu 13.10 this done by:

sudo service kmod start

while for previous versions like 13.04 you instead will need to do:

sudo service module-init-tools start

Step 6. Figure out which sensors are in use:

sensors

(the ones that indicate 0 degrees are not in use, I don't know why those are "detected" too). Remember which ones are in use.

Step 7. Find out the full paths of these sensors:

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

The output should be a list of paths like /sys/devices/...

Step 8. Copy-paste the paths to the sensors into the configuration file /etc/thinkpad.conf. To do this, first open up the file:

sudo nano /etc/thinkfan.conf

There should already be a line like

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

(the #-symbol means that that line is commented out). Add a line starting with sensor (without the #-symbol) and copy-paste you first sensor. Repeat this if you have more than one sensor. For example, on my machine, the output in step 7 yields

/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 

The ones that are in use in my machine are the ones in the first and the last two lines, so I added the three lines:

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

Step 9. Finally we can set the fan speed levels in the configuration file. Open the /etc/thinkpad.conf file if it wasn't open already.

sudo nano /etc/thinkfan.conf

The fan levels I use on my ThinkPad x201 are:

(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) 

The last line ensures full fan speed (127 = "disengaged" i.e. unregulated). You can fiddle with these levels to fit your needs/wishes, but PLEASE BE CAREFUL!

Step 10. Reboot. Everything should work now. In order to check whether thinkpad is runnning correctly, use

sudo thinkfan -n

which starts thinkfan in verbose mode. You might want to stop the thinkfan daemon first:

sudo /etc/init.d/thinkfan stop

If you want to start the thinkfan daemon again, type:

sudo /etc/init.d/thinkfan start

Just to be complete, my /etc/thinkfan.conf configuration file is:

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

Share

Improve this answer

Follow

edited Mar 3, 2020 at 22:21

Kevin Bowen

18.7k5555 gold badges7373 silver badges8080 bronze badges

answered Jan 8, 2014 at 16:38

Kris

99888 silver badges1010 bronze badges

  • 3

    One comment: you want to have larger overlap of temperature values as in the table commented out. Especially in the 45-55 range. Otherwise, the fan speed keeps flipping. That's very disturbing. (Constant fan noise does not disturb so much as fluctuating noise.)

    – HongboZhu

    Feb 6, 2015 at 16:36
  • 5

    We (the linux community) really suck at UX. :( Setting a fan speed shouldn't be a 10 step process.

    – Alexander

    Feb 28, 2017 at 22:53
  • 3

    @Alexander If you feel strongly about this, you're free to write and maintain a little program to automate this process.

    – Kris

    Mar 2, 2017 at 22:14
  • 1

    @Kris I'd be more inclined to modify the original program to not have such a nonsensical configuration process. Alas, I dont have a thinkpad, I was just passing by this post looking for thr fan control options available out there.

    – Alexander

    Mar 2, 2017 at 22:18
  • 1

    How do you know which sensors are used by your machine and which ones aren't?

    – sequence

    Aug 8, 2021 at 8:48
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这是老外开发的IBM风扇控制程序,能自己控制风扇转动的温度和速度。 打开编辑fancontrol.ini文件,改变active=1,默认为0,退出,运行fancontrol.exe,选择mode为smart即可通过程序控制风扇转动速度。 温度控制值在fancontrol.ini文件中可改变。 我的测试结果,如果温度选择 48度-52度风扇转速1,在CPU降频使用时,风扇的转速噪音基本可以忽略,风扇启停的比例大概是1:1,如把风扇风量固定选1,则CPU温度在45~46度之间变动。 现在感觉要是能最小化就好了,这个程序经过我昨天一晚上的下载东西的测试来看,还是不错的,按上面的设定,CPU温度就没超过52度,应该没什么大碍。 这个程序一关闭,风扇的控制权就交给BIOS了。最新版v018,增加可忽略一些温度的选择。 fancontrol.ini的设置: 1:Active=(0,1,2) 设置风扇控制程序的状态,0为不控制,1为容许控制,2为启动后就自动控制; 2:Cycle=5 设置检测温度的时间间隔,5为5秒; 3:MinimizeToSysTray=(0,1) 设置最小化时的状态,0为不变化,1为最小化到系统托盘; 4:MinimizeOnClose=(0,1) 设置选择关闭程序时的状态,0为关闭,1为最小化到系统托盘; 5:StartMinimized=(0,1) 设置程序启动时是最小化还是隐藏到系统托盘,0为最小化,1为到系统托盘; 6:IconLevels=50 55 60 选择系统图标三种颜色代表的温度,第一位对应黄色,第二位对应橙色,第三位对应红色; 7:FanBeep=1 1 设置风扇启动和停止的时间,单位为ms; 8:MaxReadErrors= 10 设置在出现读温度值错误的次数,程序将转入BIOS控制; 9:IgnoreSensors=PWR,YYY,ZZZ 设置程序忽略控制的温度项目,填入相应的名称,则程序将不考虑此项温度值; 10:Level=48 0 Level=51 1 Level=55 4 Level=60 7 Level=70 128 设置程序控制的温度值和相对应的风扇转速,按系统各部件的最高温度控制;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值