<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
  <title>Linux下笔记本的风扇控制问题 - Blog on 27th Floor</title>
<LINK REL="SHORTCUT ICON" HREF="favicon.ico">
  <!-- some meta information (search engines might read this) -->
  <meta name="generator" content="Nucleus CMS v3.70" />
  <meta name="description" content="???????????" />

  <!-- stylesheet definition (points to the place where colors -->
  <!-- and layout is defined -->
  <link rel="stylesheet" type="text/css" href="http://blog.cathayan.org/skins/default.css" />

  <!-- prevent caching (can be removed) -->
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
  <meta http-equiv="Expires" content="-1" />
  
  <!-- extra navigational links -->
  <link rel="bookmark" title="Nucleus" href="http://nucleuscms.org/" />
  <link rel="alternate" type="application/xml+rss" title="RSS" href="xml-rss2.php" />
  <link rel="archives" title="Archives" href="xml-rss2.php?archivelist=1" />
  <link rel="top" title="Today" href="http://blog.cathayan.org/" />
  <link rel="next" href="xml-rss2.php?itemid=1868" title="Next Item" />
  <link rel="prev" href="xml-rss2.php?itemid=1866" title="Previous Item" />
  <link rel="up" href="xml-rss2.php?blogid=1" title="Today" />

</head>
<body>

<!-- here starts the code that will be displayed in your browser -->
<div class="contents">


 <!-- this is a normally hidden link, included for accessibility reasons -->
 <a href="#navigation" class="skip">Jump to navigation</a>

 <!-- inserts the selected item using the template named 'detailed' -->
 <h3 class="item"><a href="xml-rss2.php?itemid=1867" style="font-weight:bold;">Linux下笔记本的风扇控制问题</a></h3>
<hr />
<div style="font-size:x-small;color:grey;margin:0.3em;">02/01/09。&nbsp;&nbsp;<a href="http://cathayan.org">cathayan.org</a>版权所有，保留一切权利。转载请保留此说明。谢绝商业转载。</div>
<br />
<div class="itembody">
  题目比较大，实际上只有IBM thinkpad T40和Dell 640m各一台。问题的起因是这台T40近来老是疯狂地转风扇，声音很大。上网搜了下think的风扇控制，发现了<a href="http://www.lm-sensors.org/wiki">lm-sensors</a>这个软件。<br />
<br />
Lm看上去像是Linux monitor的意思，是一个监控系统硬件信息的工具。这个工作很大程度上依赖于硬件生产商，没有资料的话很难做。所以现在这个小软件支持的硬件也是有限的。<br />
<br />
幸运的是lm-sensors支持thinkpad T40非常好，先用sensors-detect探测一下机器上可以用的信息，再运行sensors就可以看到温度等信息了。如果要控制风扇，就需要用pwmconfig来配置一下fancontrol这个工具。pwm就是脉宽调制，用Linux就是要达到这个程度啊。sensors-detect探测的时候，会说明有哪些核心模块要加载，最后会给出修改/etc/modules的命令，如果愿意还可以让它自动修改。<br />
<br />
这里主要是个thinkpad-acpi模块，加上fan_control=1这个参数加载即可。<br />
<br />
pwmconfig也就是测试一下风扇在什么样的pwm下开转，多大比例到多大转速，了解之后就可以设定温度到多少开始转，超过多少要猛转；还有最小用什么样的pwm，最大用什么样的pwm。一般没有必要用到最高转速，那样声音会非常大，所以最大也给个中间的值就可以了。<br />
<br />
以上命令都是lm-sensors这个包提供的。它还提供了fancontrol这个控制脚本，可以在系统启动时就运行，rcconf加上就可以了。<br />
<br />
最直接的方法，是给/proc/acpi/ibm/fan这个东西传参数，echo level 2 > fan这样的，风扇运行级别从0到7，2是比较慢的，声音比较可以接受。<br />
<br />
IBM有thinkpad-acpi这种好模块用，Dell就不行。用sensors-detect基本探测不到什么东西，<a href="http://www.lm-sensors.org/ticket/2358">据说</a>是生产商不提供产品规格。所以pwmconfig就进行不下去，fancontrol自然也就无望了。<br />
<br />
但还是有一位牛人写了个模块，<a href="http://www.diefer.de/i8kfan/index.html">叫做i8k</a>，Dell机器专用，可以读到一些系统硬件信息，应用程序叫i8kutils，其中包括i8kctl和i8kfan等，使用也不麻烦。但如果总是自己控制，也比较累，还是以前发现过的gkrellm这个系统监控程序，它有一个i8k的插件，可以设定改变风扇转速的温度值，还分用电池和插电两种情况，也算可以使用。<br />
<br />
i8k加载的时候可能需要force=1这个参数。<br />
<br />
Dell机器略微新一些，风扇响声不大，似乎它自己控制得就很好，用gkrellm也就是看个样子；T40上自动管理时总是猛转，还是略微管一下要好一些。还有个<a href="http://dellfand.dinglisch.net/">dellfand</a>，独立的管理Dell笔记本风扇的小程序，可惜debian没收录，就懒得试了。
<br /><br />
  
</div><div class="iteminfo">
02/01/09 22:00:42，由<a href="xml-rss2.php?memberid=1">cathayan</a>发表。目录：<a href="xml-rss2.php?catid=2">电脑</a>
</div>

 <!-- this tag inserts the comments on the selected item, also using the -->
 <!-- template with name 'detailed'                                      -->
 <h2>Comments</h2>
 <h4>4条评论</h4><h3 class="comment"><a name="9948"></a>gnawux：</h3>
<div class="commentbody">
  lm-sensors ? lm ???? linux monitor ????lm?????NSC???NSC?lm??????
</div>
<div class="commentinfo">
于 02/02/09 09:48:01 发表&nbsp;&nbsp;<a href="" rel="nofollow"></a>
</div><h3 class="comment"><a name="9949"></a>cathayan：</h3>
<div class="commentbody">
  ?????????
</div>
<div class="commentinfo">
于 02/02/09 22:14:49 发表&nbsp;&nbsp;<a href="" rel="nofollow"></a>
</div><h3 class="comment"><a name="9954"></a>joecen：</h3>
<div class="commentbody">
  laptop????????????????????????
</div>
<div class="commentinfo">
于 02/06/09 13:28:08 发表&nbsp;&nbsp;<a href="http://www.joecen.com" rel="nofollow">http://www.joecen.com</a>
</div><h3 class="comment"><a name="9956"></a>cathayan：</h3>
<div class="commentbody">
  ?????????????????????????????????thinkpad?????????
</div>
<div class="commentinfo">
于 02/06/09 19:41:58 发表&nbsp;&nbsp;<a href="" rel="nofollow"></a>
</div><hr />

 <h2>Add Comments</h2>
 <div class="commentform">This item is closed, it's not possible to add new comments to it or to vote on it</div>


  <a name="trackback" id="trackback"></a>
  <h2>TrackBack</h2>
  

</div><!-- end of the contents div -->


<!-- definition of the logo (top) -->
<div class="logo">
  <div class="logo-pic">
   <img src="http://barb.51.net/images/newlogo.jpg" alt="Blog on 27th Floor">
  </div>
  <div class="logo-text">
<form method="get" action="xml-rss2.php">
	<div class="searchform">
<input type="hidden" name="amount" value="0" />
<input type="hidden" name="blogid" value="1" />
		<input name="query" alt="Keywords to search" class="formfield" size="10" maxlength="60" accesskey="4" value="" />
		<input type="submit" alt="Search" value="Search" class="formbutton" />
	</div>
</form>

  </div>
<div class="logo-menu">
	<div class="tabs">
      <a href="xml-rss2.php?blogid=1">ä»Šæ—¥</a>
      <a href="xml-rss2.php?archivelist=1">æ¡£æ¡ˆ</a>
      <a href="http://blog.cathayan.org/nucleus/">ç®¡ç†åŒº</a>    
      <a href="http://barb.51.net/index.php?&blogid=1">å…¨éƒ¨</a>
      <a href="http://barb.51.net/category/1/blogid/1">éšä¾¿</a>
      <a href="http://barb.51.net/category/2/blogid/1">ç”µè„‘</a>
      <a href="http://barb.51.net/category/3/blogid/1">ç”µå½±</a>
      <a href="http://barb.51.net/category/5/blogid/1">ç¤¾ä¼š</a>
      <a href="http://barb.51.net/category/6/blogid/1">é˜…è¯»</a>
      <a href="http://barb.51.net/category/8/blogid/1">ä¸‹è½½</a>
      <a href="http://barb.51.net/category/9/blogid/1">æœ¬ç«™</a>
      
      </div>
      <div class="personalBar"></div>
  </div>
</div><!-- end of logo(top) -->


<!-- definition of the menu -->
<div class="menu">
 
<br>
 <!-- accessibility anchor 
 <a name="navigation" id="navigation" class="skip"></a>
 <h1 class="skip">å¯¼  èˆª</h1>

 <ul class="nobullets">
  <li><a href="xml-rss2.php?blogid=1">ä»Š  æ—¥</a></li>
  <li><a href="xml-rss2.php?archivelist=1">æ¡£  æ¡ˆ</a></li>
  <li><a href="http://blog.cathayan.org/nucleus/">ç®¡ç†åŒº</a></li>
 </ul>


 <h2>ç›®  å½•</h2>
 <ul class="nobullets">
 <li><a href="xml-rss2.php?blogid=1">All</a></li> <li><a href="xml-rss2.php?catid=8&amp;blogid=1">下载</a></li> <li><a href="xml-rss2.php?catid=9&amp;blogid=1">本站</a></li> <li><a href="xml-rss2.php?catid=1&amp;blogid=1">杂七杂八</a></li> <li><a href="xml-rss2.php?catid=2&amp;blogid=1">电脑</a></li> <li><a href="xml-rss2.php?catid=3&amp;blogid=1">看电影</a></li> <li><a href="xml-rss2.php?catid=5&amp;blogid=1">社会</a></li> <li><a href="xml-rss2.php?catid=6&amp;blogid=1">阅读</a></li></ul>

 <h2>æœ  ç´¢</h2>
-->
 
 <h2>è¯·ç™»å½•</h2>
 <a id="nucleus_lf">&nbsp;</a>
<form method="post" action="#nucleus_lf">
	<div class="loginform">
<input type="hidden" name="action" value="login" />
		

		<label for="nucleus_lf_name" accesskey="l">Username:</label>
		<input id="nucleus_lf_name" name="login" size="10" value="" class="formfield" />

		<label for="nucleus_lf_pwd">Password:</label>
		<input id="nucleus_lf_pwd" name="password" size="10" type="password" value="" class="formfield" />

		<input type="checkbox" value="1" name="shared" id="nucleus_lf_shared" />
		<label for="nucleus_lf_shared">Shared Computer</label>

		<input type="submit" alt="Log In" value="Log In" class="formbutton" />
	</div>
</form>


 <h2>æœ€æ–°è´´</h2>
     

 <h2>æœ€æ–°è¯„è®º</h2>
     

 <h2>å‹æƒ…é“¾æŽ¥</h2>äº¤æ¢é“¾æŽ¥è¯·æŒ‰ä¸‹æ–¹è”ç³»æ–¹å¼è”ç³»
 <ul class="nobullets">
  <li><a href="http://nucleuscms.org/" title="This site is Nucleus-powered">Nucleus</a></li>
  <li><a href="http://news.com.com/" title="cnet news.com">news.com</a></li>
  <li><a href="http://slashdot.org/" title="news for nerd">slashdot.org</a></li>
  <li><a href="http://www.google.com/" title="Search the web">Google</a></li>
  <li><a href="http://cnblog.org/" title="ä¸­æ–‡Blogç›®å½•">cnblog.org</a></li>
  <li><a href="http://www.mikemcbrideonline.com/blogger.html">mikemcbrideonline</a>
  <li><a href="http://www.laogui.com">Laogui's weblog</a></li>
  <li><a href="http://geourl.org/near/?p=http://barb.51.net" title="check out my neighbors in meatspace"><img src="http://geourl.org/geourl.png" border=0 width=52 height=14 /></a>
  <li><a href="http://barb.51.net/xml-rss2.php"><img src="/images/xml.gif" alt="RSS2"> RSS v2.0</a>
  <li><a href="http://barb.51.net/xml-rss.php"><img src="/images/xml.gif" alt="RSS1"> RSS v0.9</a>
 </ul>
 <h2>Powered by</h2>
<center> <div class="nucleusbutton">
	<a href="http://nucleuscms.org/"><img src="nucleus2.gif" width="46" height="43" alt="Powered by Nucleus CMS" title="Powered by Nucleus CMS" /></a>
</div>

<br>
<a href="http://www.ringsurf.com/netring?ring=Nucleus;id=48;action=prev"><< </a> 
<a href="http://www.ringsurf.com/netring?ring=Nucleus;action=rand">?</a> 
<a href="http://www.ringsurf.com/netring?ring=Nucleus;action=home 
">Nucleus</a> 
<a href="http://www.ringsurf.com/netring?ring=Nucleus;action=list">#</a> 
<a href="http://www.ringsurf.com/netring?ring=Nucleus;id=48;action=next"> >></a>
</center>

<h2>ç‰ˆæƒå£°æ˜Ž</h2>
<!-- Creative Commons License -->
<center>
<a href="http://creativecommons.org/licenses/nc-sa/1.0/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights.gif" /></a></center>
<br />
This work is licensed under a
<a href="http://creativecommons.org/licenses/nc-sa/1.0/">Creative Commons License</a>.
<!-- /Creative Commons License -->
<!--
<rdf:RDF xmlns="http://web.resource.org/cc/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
   <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
   <license rdf:resource="http://creativecommons.org/licenses/nc-sa/1.0/" />
</Work>

<License rdf:about="http://creativecommons.org/licenses/nc-sa/1.0/">
   <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
   <permits rdf:resource="http://web.resource.org/cc/Distribution" />
   <requires rdf:resource="http://web.resource.org/cc/Notice" />
   <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" />
   <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
   <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
</License>
</rdf:RDF>
-->
<h2>Contact</h2>
webmaster at barb.51.net<br />
qi at jabber.org
</div>

</body>
</html>