警惕 laptop-mode-tools 的 HD_IDLE_TIMEOUT 参数
来源:互联网 发布:lua 5.3 windows 安装 编辑:程序博客网 时间:2024/05/16 16:23
http://lymanrb.blogspot.com/2008/04/laptop-mode-tools-hdidletimeout.html
之前讨论影响硬盘寿命的 load/unload 的问题(见旧文一、旧文二),都是集中于对 haprm -B 参数的调整。而这次要提醒大家注意的,是 hdparm -S 参数。
这里是 man hdparm 的 -S 部分的说明。
Set the standby (spindown) timeout for the drive. This value is used by the drive to deter‐mine how long to wait (with no disk activity) before turning off the spindle motor to save power. Under such circumstances, the drive may take as long as 30 seconds to respond to a subsequent disk access, though most drives are much quicker. The encoding of the timeout value is somewhat peculiar. A value of zero means "timeouts are disabled": the device will not automatically enter standby mode. Values from 1 to 240 specify multiples of 5 seconds, yielding timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes. A value of 253 sets a vendor-defined timeout period between 8 and 12 hours, and the value 254 is reserved. 255 is interpreted as 21 minutes plus 15 seconds. Note that some older drives may have very different interpretations of these values.
看了之后冷汗直冒,实在是一个杀伤力很强的参数。如果有幸使用了 laptop-mode-tools,那么可以看一下 /etc/laptop-mode/laptop-mode.conf 里面,关于 -S 参数定义的部分。
#
# Should laptop mode tools control the hard drive idle timeout settings?
#
CONTROL_HD_IDLE_TIMEOUT=1
#
# Idle timeout values. (hdparm -S)
# Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
# for battery and for AC with laptop mode on.
#
LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200
我的 archlinux 上,laptop-mode-tools 使用的默认值仅仅是 20 秒!赶紧检查了一下 Load Cycle Count 的值(可能需要 root 权限,请自行 sudo),
$ smartctl -a /dev/sda | grep 193
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 18556
如此高的数值,1 月份买的新机器,华丽地中招了 :(
预防办法很简单,将上述各 IDLE 值相应调大即可。不知道为什么 laptop-mode-tools 的默认设置会如此“有进取心的”(这里还真没想到用什么词比较贴切,英文可以用 aggressive)。或许对于这个问题,laptop-mode 的开发方并没有给予太多关注。
Spinning down too many times may kill hard drives
Desktop hard drives are usually rated for only 40,000-50,000 spinups, and one spinup every 10 minutes will kill your 40,000-spinup HD in 277 days. So this is NOT recommended for server use, unless you increase the spinup interval dramatically, to say once every hour or two. Laptop hard drives are usually rated for around 300,000 spinups, so those will last about 2083 days or 6 years if you have them powered on 24-7.
- 警惕 laptop-mode-tools 的 HD_IDLE_TIMEOUT 参数
- 关于 laptop-mode-tools 的设置
- LINUX电源管理laptop-mode-tools
- 用 Laptop Mode Tools 配置 Linux 下的电源管理属性
- 解决Ubuntu在laptop-mode(用电池的模式)下USB鼠标失效问题
- ubuntu 10.04~10.10上安装laptop-mode
- 笔记本开启laptop mode,来降低温度
- sniff mode及其参数的解释
- getSharedPreferences(name, mode)两个参数的意思。
- EF Power Tools参数不正确的解决方法
- 警惕你的链接
- 代码的缺陷--警惕
- 必须警惕的职场禁语
- 警惕苹果的阴谋
- 警惕所谓的进口!
- 警惕sscanf的使用
- 解决Ubuntu在laptop-mode(电池供电模式)下USB鼠标失效问题
- php fopen() mode参数
- 27.3.2 CAPICOM对象——Certificate对象
- C#导出分Sheet的Excel文件
- 27.3.3 CAPICOM对象——Certificates对象
- jsp/servlet取参数乱码问题分析
- 27.3.4 CAPICOM对象——CertificateStatus对象
- 警惕 laptop-mode-tools 的 HD_IDLE_TIMEOUT 参数
- 用中值排序基数法实现树状结构
- IT正在成为基础设施
- vbscript and javascript tutorial
- 如何取得中的存储过程的返回值
- 如何下载和安装Struts 2框架 ?
- pb mdi sheet 最大化
- 善变如我
- SQLServerbcp实用工具