Bug 825461 - WD (Western Digital) Green disks do too much load cycles (writebacks idle3)
Summary: WD (Western Digital) Green disks do too much load cycles (writebacks idle3)
Status: RESOLVED WORKSFORME
Alias: None
Product: openSUSE 12.3
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: x86-64 openSUSE 12.3
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard: GOLD
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-18 05:00 UTC by kolA flash
Modified: 2019-10-21 16:18 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kolA flash 2013-06-18 05:00:30 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0

I'm splitting this of from another bug-report.
https://bugzilla.novell.com/show_bug.cgi?id=816388#c22
(the second bug)


Description:
========================================
========================================
========================================
My WD green hdds park their heads after 8 seconds because of the green-hdd specific "idle3" value. This value seems to be a factory setting of those disks. On Windows it's not a problem, because Windows doesn't writes back so often when idle. But Linux does a lot of more writebacks, so the hdd goes to sleep after 8 seconds and then comes back because of some writeback.
Changing the "idle3" value on the hdd is a difficult choise, because it's a factory default in the hdd and a change stays persistent after a power cycle. A maybe better solution would be, to extend the time until writeback in openSUSE. But I feel that's not so easy and it also brings the disadvantage of lost writes in case of power-loss.

On my desktop pc I got sdb and sdc in a software-mirror-raid configured by the motherboard (both WDC WD20EARS-00MVWB0 Caviar Green 2TB). When calling "smartctl -A" on sdb or sdc I get "SMART Disabled". 
But after enabling SMART using
  /usr/sbin/smartctl -s on /dev/sdX
I  can see the "Load_Cycle_Count" reported by smartctl rising quite fast too (about +3 per minute). But I'm not hearing any clicking from the disks.

Mainboard: ASUS M4A785TD-V EVO
# dmraid -r
/dev/sdc: pdc, "pdc_bebjhhcbgg", mirror, ok, 3906249984 sectors, data@ 0
/dev/sdb: pdc, "pdc_bebjhhcbgg", mirror, ok, 3906249984 sectors, data@ 0

I can't set the APM_level:
------------------
# /sbin/hdparm -B 192 /dev/sdc

/dev/sdc:
 setting Advanced Power Management level to 0xc0 (192)
 HDIO_DRIVE_CMD failed: Input/output error
 APM_level      = not supported
------------------

I also tested to put the hdds into standby by: hdparm -y /dev/sdX This makes a clear sound which I don't get during normal usage while "Load_Cycle_Count" counts up.

By this I think, the disks are not completely spinning down while "Load_Cycle_Count" rises (but maybe parking the heads). So setting the spin-down time using "hdparm -S" also won't help at least in my case.
========================================



Ideas for possible solutions:
========================================
========================================
========================================
1. write an ugly hack-script (probably a systemd unit?) that reads HDD head
parking time and sets it to something reasonable if it's too short. Has to be
run during boot and probably resume? Seems like something we should avoid.

2. Fix all the stuff that accesses the disk unnecessarily or too often, like
journal, syslog, etc. I don't know if this is possible at all?
========================================



Some additional information
========================================
========================================
========================================
http://www.howtoeverything.net/linux/hardware/why-some-hard-disks-wont-spin-down-hdparm
---- quote
If you own a "green drive" that comes with built-in power saving features, you might also see "APM_level=not supported" here. In that case you can't set the APM_level manually, but you can still change the spin-down time by using e.g. "sudo hdparm -S180 /dev/sda" to spin down sda after 15 minutes.
----

Tools to set WD idle3 value:
-------------------------
WD DOS tool to set idle3 value
http://support.wdc.com/product/download.asp?groupid=609&sid=113
I (Moritz) successfully used it, to set the idle3 values on both WD green hdds to 120 seconds.

http://idle3-tools.sourceforge.net/
This linux-tool is also about setting the idle3 value for Western Digital
disks. Says about itself:
Warning: This software is experimental and not well tested. It accesses low level information of your harddrive. Use at your own risk.

hdparm (already part of openSUSE) using the -J option. From the hdparm manpage:
----------
 -J     Get/set the Western Digital (WD) Green Drive's "idle3" timeout value. This timeout controls how often the drive parks its heads and enters a low power  consumption  state.
The factory default is eight (8) seconds, which is a very poor choice for use with Linux. Leaving it at the default will result in hundreds of thousands of head load/unload cycles in a very short period of time.
WD supply a WDIDLE3.EXE DOS utility for tweaking this setting, and you should use  that  program  instead  of hdparm if at all possible.  The reverse-engineered implementation in hdparm is not as complete as the  original  official program, even though it does seem to work on at a least a few drives.
----------

Is this for setting the WD idle3 value???
http://hd-idle.sourceforge.net/
Another app that may help people with WD Green disks which don't support APM,
could use or try to use. Maybe we should add this also to opensuse.
========================================



Comment 20, Vojtech Dziewiecki, 2013-06-11 09:10:42 UTC
https://bugzilla.novell.com/show_bug.cgi?id=816388#c20
========================================
========================================
========================================
> Who sets this value? Is this from pm-utils or what? Is this only openSUSE or
> any distro out there. If not, how the other distros fixed this?
> 

This has nothing to do with pm-utils. The manufacturer sets this value upon
making the drive.
I have found nothing about this being fixed in other distros apart from this
ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/607560
it says that journal had been written too often and that it's been fixed in
kernel 2.6.something.


Guide to increase the head parking timeout for WD drives:
http://www.storagereview.com/how_to_stop_excessive_load_cycles_on_the_western_digital_2tb_caviar_green_wd20ears_with_wdidle3
(Requires a dos tool provided by WD, wdidle. Hdparm does the same but its
manpage says it's beter to use the dos tool.)
Btw maybe someone from SUSE could talk to WD and hdparm upstream guy and
arrange that WD helps with making this tweak possible in linux too?  

But this happened on some laptops too, manufacturers tend to produce HDDs with
aggressive head parking times, WD Caviar Green is not the only one.

Reproducible: Always
Comment 1 Robert Milasan 2013-07-23 13:37:05 UTC
Why is this assign to me?
Comment 2 kolA flash 2013-07-23 13:43:14 UTC
Don't ask me why FeiXiang did that... :-/
--------


Tue, 23 Jul 2013 03:37:21 -0700 (PDT)

https://bugzilla.novell.com/show_bug.cgi?id=825461#c

FeiXiang Zhang <fxzhang@suse.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|bnc-team-screening@forge.pr |rmilasan@suse.com
                   |ovo.novell.com              |
Comment 3 Robert Milasan 2013-07-23 13:58:13 UTC
Sorry, you are right :)
Comment 4 Fei Xiang Zhang 2013-07-24 02:33:55 UTC
(In reply to comment #1)
> Why is this assign to me?

Hi Robert,
Because you are the assignee of bug 816388,So I think maybe you are the right assignee here.
Comment 5 Robert Milasan 2013-07-24 06:56:08 UTC
Well, that doesn't matter, Im not the right one for eider for them.
Comment 6 Jean Delvare 2013-07-24 12:55:47 UTC
I can take it, as I do have one of these drives. It is unlikely that I'll have the time to work on this before I leave for vacation though.
Comment 7 kolA flash 2013-07-29 12:17:43 UTC
Please tell me if I can help.

I know, this problem isn't easy to solve, because it's not the nice way to change firmware-settings in the users devices (which I did -> changed from 8 to 120 seconds).

The nice way probably would be, to keep openSUSE from writing back too often. Maybe changing
  /proc/sys/vm/dirty_writeback_centisecs
will help???
Comment 8 Jean Delvare 2016-10-05 06:31:06 UTC
It turns out I'm not actually working on this, sorry, and I no longer have this hard disk drive in my machine either.
Comment 9 Tomáš Chvátal 2017-12-18 11:07:11 UTC
Is this still an issue, I don't see any reports in TW/Leap... Also the green WD I can test with has a really low cycle.

Please open a new report if you are still reporting it as 12.3 is out of support.
Comment 10 Moritz Duge 2019-10-21 16:18:10 UTC
(In reply to Tomáš Chvátal from comment #9)
> Is this still an issue, I don't see any reports in TW/Leap... Also the green
> WD I can test with has a really low cycle.
> 
> Please open a new report if you are still reporting it as 12.3 is out of
> support.

Indeed, it looks like this is still present in openSUSE-LEAP-15.1.
Bug 1154665 - too much HDD load cycles (hdparm -B)