Andrea wrote:
Hi all,
I'm writing to report that I have detected the "unload cycle bug" while
running SL5.1 on my laptop. This "bug" has received some attention
months ago when it was found in Ubuntu¹ and consequently featured on
Slashdot².
----- SUMMARY -----
Some hard disk manufacturers ship their drives - especially laptop
drives - preset with some aggressive power saving settings. These
settings cause the hard disks to park their heads after a very short
inactivity time.
This hectic parking/deparking activity dramatically shortens the disk's
life.
Said manufacturers apparently take for granted that the OS will set more
sensible power saving defaults for the hard disk. Linux distros often
don't do this. So it's not exactly a "bug", rather an omission (even
though it can be argued that this is not really "Linux's fault").
----- DIAGNOSIS -----
The continued parking/deparking is typically easier to detect on a
laptop, where you might hear periodic "clicks" coming from the hard
disk.
A more reliable way is to watch the output of the following `sh` command
line, to be issued as root while your system is AC powered (as opposed
to battery powered) and not performing disk-intensive tasks:
while true;do smartctl -a /dev/hda|grep Load_Cycle_Count;sleep 120;done;
If the last number is constantly increasing every 1 or 2 lines, your
system is affected.
----- A SOLUTION -----
The command:
hdparm -B254 /dev/hda
changes the primary drive's (/dev/hda) power settings to "almost never
park heads". A lower number *might* be desired when running on battery,
and an ideal solution would include a way to change that number
according to power source (I don't know yet how to do this).
For the moment, I suggest that the above command be put
into /etc/rc.local to make sure it is executed at boot.
Best regards,
Andrea Remondini
----- NOTES -----
¹ <https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695>
² <http://hardware.slashdot.org/article.pl?sid=07/10/30/1742258>
This doesn't seem to work on my desktop system:
[EMAIL PROTECTED] ~]# while true; do smartctl -a /dev/hdc |grep
Load_Cycle_Count; sleep 120; done;
[EMAIL PROTECTED] ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
287G 34G 239G 13% /
/dev/hdc1 99M 28M 67M 30% /boot
tmpfs 506M 0 506M 0% /dev/shm
[EMAIL PROTECTED] ~]#
I left it more than 120 seconds.