about ubuntu hard disk

about ubuntu hard disk

DanielHahler/Bug59695

[WWW] Bug 59695 (“default value in power.sh potentially kills laptop disks”) is about not preventing bad behaviour of drives (high Load_Cycle_Count numbers) on (laptop) harddrives.

Because the bug report has 150 comments already, I’ve tried to summarize it here.

There appear to be two issues here: HDD spin down and “Power cycling”, whereas the first one has a [WWW] relative short default (60 seconds), but the latter one gets the most complains (it’s about Load_Cycle_Count).

The disk Load_Cycle_Count issue appears to be caused by a combination of two problems — The first is overly-aggressive power management from what might be considered buggy hardware. The second is that Ubuntu appears to be touching the hard drive on a regular basis for one reason or another.

Note: In sections below relating to how to prevent damage to your hard disk, you should replace $HDD everywhere with your device, e.g. “/dev/sda” or “/dev/hda”. If you have several harddrives, you need to change it accordingly and duplicate lines in workarounds.

Check

You can check the current value of Load_Cycle_Count of your harddrive(s) using:

  • sudo smartctl -a $HDD | grep Load_Cycle_Count

(You need the smartmontools package for this. I also had to enable SMART monitoring for my drives using sudo smartctl -s on $HDD)

The values for this differ a lot (e.g. it’s 0 on my desktop), but it goes up to > 600.000 for others, depending on the lifetime. TODO: add a section with sample values (including the value of Power_On_Hours).

What Ubuntu does

It [WWW] appears to be the official policy of Ubuntu that by default, Ubuntu should not adjust any power management settings of the harddisk. Unfortunately, this policy has two negative effects: It leaves quite a few people with broken hard drives that would otherwise not be broken, and it quite simply makes people who love Ubuntu feel neglected. This issue has been going on a long time.

The problem appears to be that some manufacturers’ defaults are too aggressive and that Ubuntu might cause too many unbuffered disk accesses — the combination of which can cause over a thousand parks a day on some systems.

In /etc/acpi/power.sh, laptop mode gets handled. If it gets enabled, hdparm is called with “-B 1”, if it gets disabled with “-B 254”. 254 is the least aggressive setting. 255 is off, but does not work for all disks.

In power.sh also the spindown timeout gets set, according to SPINDOWN_TIME from /etc/default/acpi-support (default: 12). This results in spinning down the harddrive after 12*5=60 seconds of inactivitiy. This does not influence Load_Cycle_Count however.

apm

[WWW] “/etc/apm” is not supposed to be used, but if it would get, it sets spindown to 60 seconds – but does not affect the general APM setting (hdparm -B). (there’s a bug, which also used “power_conserve” here, if on_ac_power return “don’t know” – [WWW] bug 156893)

Debug

[WWW] Blue has created a script, which acts as a wrapper around hdparm and logs, where it’s called (including its arguments) From his report, it appears that hdparm always gets called through apm or the init script (the logfile excerpt appears to be from booting).

TODO: provide said helper script, allowing others to help to debug this.

Workaround

Various workarounds have been provided.

Try hdparm -B 255 $HDD or hdparm -B 254 $HDD. (255 is supposed to disable APM, but it does not work for some; so 254 sets it to the less aggressive setting)

There are different methods to keep this setting after reboot/resume. Your mileage may vary. There may be more workarounds in the bug report, but essentially, all are using “hdparm -B” to change the apm handling of the harddrive.

Force hdparm values in acpi hooks

Gilles posted the following workaround: Create a file called 99-fix-park.sh (keep the ’99-‘ and the ‘.sh’, but you can name the file as you like otherwise) with the following two lines:

 #!/bin/sh
hdparm -B 254 $HDD

and copy it to the following directories: /etc/acpi/resume.d/ and /etc/acpi/start.d/ ([WWW] https://launchpad.net/ubuntu/+source/acpi-support/+bug/59695/comments/10)

laptop-mode-tools

Don posted another workaround: Install laptop-mode-tools and set CONTROL_HD_POWERMGMT=1 in /etc/laptop-mode/laptop-mode.conf ([WWW] https://launchpad.net/ubuntu/+source/acpi-support/+bug/59695/comments/19) Here’s another more verbose setup of laptop-mode-tools from Michael: [WWW] https://launchpad.net/ubuntu/+source/acpi-support/+bug/59695/comments/63

Proposed fixes

  • FIXED: Converted most remaining 255’s to 254s, and added an explanation.

Conclusion

This bug report has attracted a lot of concerned Ubuntu users and it seems quite clear from the user feedback, that other operating systems/distributions handle this better. However, the workaround should be quite simple and this wiki page is a first attempt, to fix this for the better.

Misc

ubuntu_demon has put together a list of TODOs: [WWW] https://launchpad.net/ubuntu/+source/acpi-support/+bug/59695/comments/81

Comments

Please leave any comments/additions here. You may also edit the page directly, but please try to be clear and helpful. The problem has been confirmed and we know that it’s a critical thing – please do not repeat that the bug status should be critical.

Could you kindly explain how to diagnose whether the settings on a system, at a point of time, are correct. I have followed the instructions but still find the load cycle count increasing. How do I diagnose the problem?

last edited 2007-11-12 23:26:01 by VikasRawal

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/100567.html原文链接:https://javaforall.net

(0)
上一篇 2021年5月3日 下午10:00
下一篇 2021年5月4日 上午8:00


相关推荐

  • 电脑蓝屏错误代码0x000000ED_0x00000019蓝屏win7

    电脑蓝屏错误代码0x000000ED_0x00000019蓝屏win7相信大家都遇到过电脑蓝屏的情况,而且蓝屏故障是一件非常麻烦的事情,前不久小编电脑出现蓝屏并且提示错误代码是0x000000BE,很多用户可能会直接选择重装系统,其实不用这么麻烦,出现0x000000BE很有可能是硬件设备驱动程序存在BUG或安装不正确引起,具体一起来看看。解决方法:在开机过程中按下f8键进入Windows高级启动菜单,进入安全模式,也许会有改善。再重启电脑,继续按F8键,此时可以选…

    2022年10月8日
    4
  • Java SDK的作用

    Java SDK的作用1 SDK 的概念 SDK SoftwareDeve 就是 软件开发工具包 软件开发工具包一般都是一些软件工程师为特定的软件包 软件框架 硬件平台 操作系统等建立应用软件时的开发工具的集合 简单讲 就是通过第三方服务商实现产品功能的软件工具包 比如我们日常使用的移动支付技术 语音识别技术 验证码等功能都是可以通过软件工具包实现的 开发者不需要对产品的每一项功能进行开发 选择合适的 SDK 可以花费较少的时间 实现产品的功能 2 SDK 与 API 的区别 API 是 应用程序接口 只是类

    2026年3月26日
    3
  • 廖雪峰老师的python教程中的几个学习笔记的备份

    廖雪峰老师的python教程中的几个学习笔记的备份

    2022年3月4日
    43
  • Origin2018安装教程「建议收藏」

    Origin2018安装教程「建议收藏」Origin是由OriginLab公司开发的一个科学绘图、数据分析软件,支持在MicrosoftWindows下运行,它能支持各种各样的2D/3D图形,其数据分析功能很强大,包括统计,信号处理,曲线拟合以及峰值分析。Origin中的曲线拟合是采用基于Levernberg-Marquardt算法(LMA)的非线性最小二乘法拟合,它强大的数据导入功能,支持多种格式的数据,包括ASCII、Excel、NITDM、DIADem、NetCDF、SPC等等。不仅如此,它的图形输出格式也多种多样,例如JPEG,

    2022年6月14日
    76
  • TinyXML2 入门教程

    TinyXML2 入门教程TinyXML2是simple、small、efficient开源的C++XML文件解析库,可以很方便的应用到现有的项目之中。非常适合存储简单数据,配置文件,对象序列化等数据量不是很大的操作。TinyXML2详细介绍与源码获取方法详见:TinyXML2官网。

    2022年4月26日
    35
  • Basement 后端云服务正式亮相云栖大会!

    Basement 后端云服务正式亮相云栖大会!

    2021年6月14日
    102

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号