sudo hdparm -B /dev/sda
可見(jiàn)硬盤(pán)/dev/sda的APM_level值為254,表示硬盤(pán)性能最大化,這需要保持高水平的硬盤(pán)轉(zhuǎn)速,硬盤(pán)發(fā)熱量自然就大.
如果返回
/dev/sda: APM_level = not supported
,則表示你的硬盤(pán)不支持APM(高級(jí)電源管理).
APM_level的全稱為Advanced Power Management level,即(硬盤(pán))高級(jí)電源管理級(jí)別.
man hdparm 可見(jiàn):
Get/set Advanced Power Management feature, if the drive supports it.
A low value means aggressive power management and a high value means better performance.
Possible settings range from values 1 through 127 (which permit spin-down), and values 128 through 254 (which do not permit spin-down).
The highest degree of power management is attained with a setting of 1, and the highest I/O performance with a setting of 254.
A value of 255 tells hdparm to disable Advanced Power Management altogether on the drive (not all drives support disabling it, but most do).
該值的取值范圍為1~255,值越大,硬盤(pán)性能越高,其中255表示關(guān)閉硬盤(pán)/dev/sda的電源管理,254表示在開(kāi)啟電源管理下的最高性能,1表示最低的硬盤(pán)性能但最省電.
這個(gè)值在1~127區(qū)間時(shí)允許spin-down,在128~254這個(gè)區(qū)間則禁止spin-down.
spin-down是指在閑置時(shí)掛起硬盤(pán),停止轉(zhuǎn)動(dòng),但是頻繁的spin-down和spin-up會(huì)使硬盤(pán)壽命變短.
所以,即使你追求節(jié)能,減少發(fā)熱量,也建議你將該值設(shè)為128,執(zhí)行以下命令即可:
sudo hdparm -B 128 /dev/sda
我的操作系統(tǒng)為Ubuntu 14.04(Kernel 3.14),我把該值設(shè)為128,在氣溫26度的情況下,硬盤(pán)溫度僅為36度(對(duì)比:此時(shí)CPU溫度為39度).

如果設(shè)為254,硬盤(pán)溫度甚至?xí)噬?5度,雖然這仍是一個(gè)正常的硬盤(pán)溫度,但對(duì)于筆記本用戶來(lái)說(shuō),靠近硬盤(pán)處的發(fā)熱量是很容易察覺(jué)到的.
另外電機(jī)持續(xù)高速的旋轉(zhuǎn)也會(huì)加快減少硬盤(pán)的壽命.
在性能和節(jié)能間做個(gè)折中,個(gè)人把APM_level設(shè)為192,讓其開(kāi)機(jī)自動(dòng)設(shè)置,在/etc/rc.local中加入:
hdparm -B 192 /dev/sda
如果/etc/rc.local不生效,可以在/etc/hdparm.conf中加入:
/dev/sda {
apm = 192
apm_battery = 192
}
apm表示在交流電供電模式下, apm_battery表示在電池供電模式下.
注意: 設(shè)置APM后執(zhí)行以下命令查看Load_Cycle_Count值
sudo smartctl -a /dev/sda | grep Load_Cycle_Count
如果Load_Cycle_Count值每分鐘都在增加,這時(shí)你應(yīng)該把APM值設(shè)回原來(lái)的254,方法同上可以在/etc/hdparm.conf里修改.
執(zhí)行命令
sudo hdparm -B 254 /dev/sda
即時(shí)生效, 配置在重啟后生效.
因?yàn)榇蓬^頻繁的Load/Unload同樣會(huì)影響硬盤(pán)壽命,一般硬盤(pán)設(shè)計(jì)能承受的加載循環(huán)計(jì)數(shù)Load_Cycle_Count最多為600000次.