当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 88 篇帖子 ]  前往页数 1, 2, 3, 4, 5, 6  下一页
作者 内容
1 楼 
 文章标题 : 解决一下喽,,Ubuntu正在成为我的笔记本硬盘杀手??[已解决]
帖子发表于 : 2007-11-01 22:56 

注册: 2006-11-23 13:04
帖子: 900
送出感谢: 0 次
接收感谢: 0 次
Ubuntu也许将成为你的笔记本硬盘杀手
Ubuntu系统的ACPI电源管理默认设置存在问题,当用户切换到电池供电模式时,/etc/acpi/power.sh向所有块设备发出一个hdparm -B 1命令,这会导致出现频繁的负荷循环(load cycles)。发现Bug #59695的用户称仅在100小时内就出现了7000次负荷循环。大多数笔记本硬盘只能承受至多60万次此类循环,这意味着它会大幅度减少笔记本硬盘的寿命。SATA硬盘用户可以输入“smartctl -d ata -a /dev/sda”命令来查看负荷循环次数,但需要先安装Smartmontools软件包(apt-get下)。
*********************************
ubuntu在ENABLE_LAPTOP_MODE是true的情况下,当切换至电源时hdparm -B 1才会被执行。而ubuntu默认是将ENABLE_LAPTOP_MODE设置为false的,默认安装完gusty后grep ENABLE_LAPTOP_MODE /etc/default/acpi-support 得到的是false. 在这种情况下就算是切换至电池,hdparm -B 1也不会被执行,因为切换至电池时执行的脚本是/etc/acpi/power.sh, 其中判断执行不执行hdparm -B 1的一段是这样写的:
if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
(sleep 5 && laptop_mode_enable)&
fi
而laptop_mode_enable是执行hdparm -B 1命令的。所以默认情况下(ENABLE_LAPTOP_MODE = false)含有hdparm -B 1的laptop_mode_enable是不被调用的。 我使用的是hp6220 + gusty,默认hdparm -I /dev/sda |grep Advanced 得到的是 Advanced power management level: 128 这个128就是hdparm -B xx来设置的,ubuntu默认是128,在ENABLE_LAPTOP_MODE是false的情况下,切换至电池后,这个值仍然是128而不是1。

但为什么好多人在切换至电池后这个值被设置为1呢,除了不小心将ENABLE_LAPTOP_MODE设置为true外,还有可能是笔记本BIOS默认设置是在切换至电池后就尽可能的让硬盘省电,在这种情况下ubuntu的设置就被BIOS的设置给覆盖了,所以频繁load_cycle。

这里是一名ubuntu的开发者关于此问题的解释http://www.linux-hero.com/rant/ubuntu-hard-drive-explosions/ [linux-hero.com]。


_________________
需要买七折域米的,要博客空间的,要建网站的童学猛点这里!!!

要不要折腾linode呢......纠结

还是折腾VULTR吧

都是性价比之王


最后由 dogal 编辑于 2007-11-07 17:20,总共编辑了 3 次

页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2007-11-01 23:01 

注册: 2006-11-23 13:04
帖子: 900
送出感谢: 0 次
接收感谢: 0 次
对了,
如果是TRUE
那怎样改为FALUSE呢
在哪个文件里改?


_________________
需要买七折域米的,要博客空间的,要建网站的童学猛点这里!!!

要不要折腾linode呢......纠结

还是折腾VULTR吧

都是性价比之王


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2007-11-01 23:21 
头像

注册: 2007-10-27 22:11
帖子: 9
送出感谢: 0 次
接收感谢: 0 次
我查看时出现:

Smartctl open device: /dev/sda failed: Permission denied
这是怎么回事?


页首
 用户资料  
 
4 楼 
 文章标题 :
帖子发表于 : 2007-11-01 23:43 

注册: 2007-09-21 12:13
帖子: 155
送出感谢: 0 次
接收感谢: 0 次
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 062 Pre-fail Always - 0
2 Throughput_Performance 0x0005 100 100 040 Pre-fail Offline - 0
3 Spin_Up_Time 0x0007 253 253 033 Pre-fail Always - 0
4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 531
5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0
7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0
8 Seek_Time_Performance 0x0005 100 100 040 Pre-fail Offline - 0
9 Power_On_Hours 0x0012 099 099 000 Old_age Always - 756
10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 531
191 G-Sense_Error_Rate 0x000a 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 33
193 Load_Cycle_Count 0x0012 099 099 000 Old_age Always - 19786
194 Temperature_Celsius 0x0002 144 144 000 Old_age Always - 38 (Lifetime Min/Max 23/50)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x000a 200 253 000 Old_age Always - 0
223 Load_Retry_Count 0x000a 100 100 000 Old_age Always - 0

我的是这个结果,是不是表示有问题?


页首
 用户资料  
 
5 楼 
 文章标题 :
帖子发表于 : 2007-11-03 10:48 

注册: 2006-11-23 13:04
帖子: 900
送出感谢: 0 次
接收感谢: 0 次
看不懂
3楼的用SUDO
我的是FALSE


_________________
需要买七折域米的,要博客空间的,要建网站的童学猛点这里!!!

要不要折腾linode呢......纠结

还是折腾VULTR吧

都是性价比之王


页首
 用户资料  
 
6 楼 
 文章标题 :
帖子发表于 : 2007-11-03 10:58 

注册: 2006-01-10 19:09
帖子: 1334
送出感谢: 0 次
接收感谢: 0 次
坏了正好换新的保修期内


页首
 用户资料  
 
7 楼 
 文章标题 :
帖子发表于 : 2007-11-03 11:07 
头像

注册: 2006-12-23 13:46
帖子: 9203
地址: Azores Islands
送出感谢: 0 次
接收感谢: 1
引用:
The situation is somewhat less clear than you might think from the article, but the basic takeaway message is that Ubuntu doesn't touch your hard drive power management settings by default. In almost all cases, it's more likely to be your BIOS or the firmware on your hard drive.

The script that's executed when you plug or unplug your laptop is /etc/acpi/power.sh. The relevant sections are:

function laptop_mode_enable {
...
$HDPARM -S $SPINDOWN_TIME /dev/$drive 2>/dev/null
$HDPARM -B 1 /dev/$drive 2>/dev/null
}

That is, when the laptop_mode_enable function is called, we set the drive power parameters. Now, by default laptop_mode_enable isn't called:

if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
(sleep 5 && laptop_mode_enable)&
fi

because ENABLE_LAPTOP_MODE is false in the default install (check /etc/default/acpi-support). This means that, by default, we do not alter the hard drive power settings. In other words, the APM settings that your drive is using in Ubuntu are the ones that your BIOS programmed into it when the computer started. This is supported by the fact that people see this issue after resuming from suspend. We don't touch the hard drive settings at that point, so the only way it can occur is if your BIOS or drive default to this behaviour.

If you enable laptop mode, then we will enable aggressive power management on the drive and that may lead to some reduction in hard drive lifespan. That's a fairly inevitable consequence of laptop mode, since it only makes sense if the laptop enages in aggressive power management. But, as I said, that's not the default behaviour of Ubuntu.

There's certainly an argument that we should work around BIOSes, but in general our assumption has been that your hardware manufacturer has a better idea what your computer is capable of than we do. If a laptop manufacturer configures your drive to save power at the cost of life expectancy, then that's probably something you should ask your laptop manufacturer about”

So let me put this out there in capital letters, because I NEVER wanted any semblance of bad publicity for Ubuntu. UBUNTU DOES NOT OVERWORK YOUR HARD DRIVE UNLESS IT IS IN LAPTOP MODE.

How can you tell if your machine is in laptop mode? Easy.

root@linux-hero.com:/ grep ENABLE_LAPTOP_MODE /etc/default/acpi-support

If the returned value is true, your machine is in laptop mode and you may wish to alter your power management settings accordingly. I have not tested this, however I imagine you can choose a less aggressive number in the aforementioned script /etc/acpi/power.sh at the line that reads:
<code>$HDPARM -B 1 /dev/$drive 2>/dev/null</code>

When doing so, keep in mind that 255 completely disables power management, and 1 is the most aggressive setting. Find a happy medium that works for your laptop if you’re interested in striking a balance between battery life and hard drive longevity.

If it comes back false, you’re fine. It should also be noted per the developer that laptop mode is off by default. I’m imagining though, that many people when going through the install see the advanced power management stuff in the list of packages and turn it on without thinking about it. Perhaps a small warning, even in the /etc/default/acpi-support file is in order?

I’m going to close with the statement that I truly love Ubuntu, and it is in my opinion the best distro available right now, and I never wanted bad publicity for them. This article was originally just an excuse for me to do some research and learn about hard drive load/unload cycles. All the rest of this is just 17,000 hits of side effects. (Gentoo users, I like that one a lot too… I swear. No flame wars please.)


_________________
no security measure is worth anything if an attacker has physical access to the machine


页首
 用户资料  
 
8 楼 
 文章标题 :
帖子发表于 : 2007-11-03 22:30 
头像

注册: 2007-03-16 15:42
帖子: 366
送出感谢: 0 次
接收感谢: 0 次
输出了一大堆的说

smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: ST960812A
Serial Number: 5PJ0CW0Z
Firmware Version: 3.06
User Capacity: 60,011,642,880 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 6
ATA Standard is: ATA/ATAPI-6 T13 1410D revision 2
Local Time is: Sat Nov 3 22:27:21 2007 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 426) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
No General Purpose Logging support.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 84) minutes.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 110 086 006 Pre-fail Always - 28457222
3 Spin_Up_Time 0x0003 097 096 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 098 098 020 Old_age Always - 2102
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 084 060 030 Pre-fail Always - 251331471
9 Power_On_Hours 0x0032 092 092 000 Old_age Always - 7460
10 Spin_Retry_Count 0x0013 100 100 034 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 099 099 020 Old_age Always - 1944
187 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0
189 Unknown_Attribute 0x003a 094 094 000 Old_age Always - 6
190 Temperature_Celsius 0x0022 069 047 045 Old_age Always - 521535519
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 422
193 Load_Cycle_Count 0x0032 078 078 000 Old_age Always - 45072
194 Temperature_Celsius 0x0022 031 053 000 Old_age Always - 31 (Lifetime Min/Max 0/6)
195 Hardware_ECC_Recovered 0x001a 066 048 000 Old_age Always - 82001339
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0000 100 253 000 Old_age Offline - 0
202 TA_Increase_Count 0x0032 100 253 000 Old_age Always - 0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.


页首
 用户资料  
 
9 楼 
 文章标题 :
帖子发表于 : 2007-11-03 23:30 

注册: 2007-11-01 14:51
帖子: 4
送出感谢: 0 次
接收感谢: 0 次
真的还是假的啊?我才入门ubuntu哦,才把它装在我的本上!!
这个看来让人害怕!


页首
 用户资料  
 
10 楼 
 文章标题 :
帖子发表于 : 2007-11-04 9:09 

注册: 2006-11-23 13:04
帖子: 900
送出感谢: 0 次
接收感谢: 0 次
为什么我的
sudo hdparm -I /dev/sda |grep Advanced
Advanced power management level: unknown setting (0x0080)
* Advanced Power Management feature set
ubuntu默认是128

为什么我的本本没有设置显示??
怎么改呀


而且发现sudo smartctl -a /dev/sda | grep Load_Cycle_Count
的值变得还挺快
虽然我的grep ENABLE_LAPTOP_MODE /etc/default/acpi-support 是FALSE

快到一分钟一次甚至一分钟几次!!!


sudo smartctl -a /dev/sda | grep Load_Cycle_Count
193 Load_Cycle_Count 0x0032 171 171 000 Old_age Always - 89800
现在想想我在本本上装了很多种LINUX 和很多便WINDOWS
想想真是不该呀
我的本本
成了我的试验品
以后没事再也不重装了


咋办呀??


_________________
需要买七折域米的,要博客空间的,要建网站的童学猛点这里!!!

要不要折腾linode呢......纠结

还是折腾VULTR吧

都是性价比之王


页首
 用户资料  
 
11 楼 
 文章标题 :
帖子发表于 : 2007-11-04 9:51 
头像

注册: 2007-09-17 21:58
帖子: 106
送出感谢: 0 次
接收感谢: 0 次
我的没问题…


页首
 用户资料  
 
12 楼 
 文章标题 :
帖子发表于 : 2007-11-04 13:16 

注册: 2006-11-23 13:04
帖子: 900
送出感谢: 0 次
接收感谢: 0 次
现在成了这么多
sudo smartctl -a /dev/sda | grep Load_Cycle_Count
193 Load_Cycle_Count 0x0032 171 171 000 Old_age Always - 89862


_________________
需要买七折域米的,要博客空间的,要建网站的童学猛点这里!!!

要不要折腾linode呢......纠结

还是折腾VULTR吧

都是性价比之王


页首
 用户资料  
 
13 楼 
 文章标题 :
帖子发表于 : 2007-11-04 15:33 

注册: 2007-06-01 22:11
帖子: 209
送出感谢: 0 次
接收感谢: 0 次
Enigma@Enigma:/etc/ppp/peers$ sudo smartctl -a /dev/sda | grep Load_Cycle_Count
193 Load_Cycle_Count 0x0032 096 096 000 Old_age Always - 41485
我的,硬盘用一年了。


页首
 用户资料  
 
14 楼 
 文章标题 :
帖子发表于 : 2007-11-04 15:58 

注册: 2007-06-13 19:47
帖子: 43
送出感谢: 0 次
接收感谢: 0 次
是不是说使用电池时才会出现这种情况?还是使用交流电源时也出现?现在我都不敢进ubuntu了,高度关注这个问题。我ubuntu用的不是很多(今年5月才装的7.04,电脑是2月份买的。),但是load/unload cycle count 已经有46339了。问题不解决不敢用ubuntu了。u的电源管理实在令我伤心,首先是关机不能关闭电源,其次就是这个问题。

大家把自己的load/unload cycle count和power-on time count(贴这个是为了看硬盘的通电运行总时间。)贴出来看看。


页首
 用户资料  
 
15 楼 
 文章标题 :
帖子发表于 : 2007-11-04 21:48 
头像

注册: 2006-11-23 15:47
帖子: 164
送出感谢: 0 次
接收感谢: 2
我的本本装乌班图的时候,硬盘总是在响,经常听到磁头归位的声音。
换回XP后一点都没问题。


难道这真是的楼主所叙述的问题?


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 88 篇帖子 ]  前往页数 1, 2, 3, 4, 5, 6  下一页

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译