Bug 391671

Summary: Increasing Load_Cycle_Count
Product: [Fedora] Fedora Reporter: Andrey Arapov <andrey.arapov>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 8CC: absent, jimis
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-20 20:46:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrey Arapov 2007-11-20 08:34:26 UTC
TOSHIBA Satellite L30-113 notebook.
Intel Celeron 430M, ATI Radeon Xpress 200M.
Fedora 8.

== Increasing Load_Cycle_Count ==

[root@fedora ~]# smartctrl --all /dev/sda
[...]
Model Family:     Hitachi Travelstar 5K100 series
Device Model:     HTS541060G9SA00
Serial Number:    MPBCPAXMGMV6PM
Firmware Version: MB3OC60R
User Capacity:    60,011,642,880 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  ATA/ATAPI-7 T13 1532D revision 1
Local Time is:    Tue Nov 20 18:03:50 2007 VLAT
[...]

[root@fedora ~]# smartctl --all /dev/sda|grep -i count
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       
-       432
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       
-       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       
-       432
192 Power-Off_Retract_Count 0x0032   099   099   000    Old_age   Always       
-       211
193 Load_Cycle_Count        0x0012   090   090   000    Old_age   Always       
-       103707
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       
-       1
199 UDMA_CRC_Error_Count    0x000a   200   253   000    Old_age   Always       
-       0

but a hour ago Load_Cycle_Count was:   103698


== ReiserFS or ...? ==

Day ago I leave my notebook on 30 minutes, and when I came back I was heard 
that my HDD was buzzing!
[noisy like the sound of a bee; doing something hard]
I tried to do something, but Fedora don't respond.. even if I press Ctrl+Alt+F2 
or Ctrl+Alt+Del..
I wait about 10 minutes..
I was forced to press and hold PowerOff button for 5 seconds for hard-shutdown..
When I turn on my laptop, I found something strange in /var/log/messages file:

Nov 19 22:09:23 fedora yum: Installed: unrar - 3.7.8-1.lvn8.i386
Nov 19 22:43:34 fedora kernel: ReiserFS: sda6: warning: vs-8115: get_num_ver: 
not directory or indirect item
Nov 19 22:43:34 fedora kernel: ReiserFS: sda6: warning: vs-8115: get_num_ver: 
not directory or indirect item


And before this Load_Cycle_Cont was about 96###, and after - 102### ...

Comment 1 Andrey Arapov 2007-11-20 13:49:00 UTC
I think I found solution to stop increasing Load_Cycle_Count.

]# hdparm -I /dev/sda|grep Advan
        Advanced power management level: 128 (0x80)
           *    Advanced Power Management feature set

The solution:
]# hdparm -B 255 /dev/sda

/dev/sda:
 setting Advanced Power Management level to disabled

]# hdparm -I /dev/sda|grep Advan
        Advanced power management level: 254 (0xfe)
                Advanced Power Management feature set


Now Load_Cycle_Count stopped increasing!


Comment 2 Phil Knirsch 2007-11-20 16:20:03 UTC
Reassigning this bug to the kernel component as it's a bug in that component.

Read ya, Phil

Comment 3 Chuck Ebbert 2007-11-20 20:46:27 UTC
That value is set by the system BIOS at power-on; we never change it. (Some
other distributions do, but not Fedora.)


Comment 4 Eric O. P. 2008-02-05 01:38:45 UTC
Bug confirmed un a Toshiba Satellite A210-FS3

I coded the following script. Do not use without checking if the HD temperature
is  not going too high. Here is the script that you can activate through
/etc/rc.d/rc.local :

==============

#! /bin/bash
#Utility that checks whether the APM level is at 254 if not, reset it there. 

SLEEP="120"

while [ true ] ; do

STATE=`hdparm -I /dev/sda | grep "Advan" | sed "s/.* \([0-9][0-9][0-9]*\).*/\1/"`
ASTATE=`echo ${STATE:0:3}`

     if [[ $ASTATE != "254" ]] ; then 
           hdparm -B 254 /dev/sda
     fi 

sleep ${SLEEP}s
done

==============

It is useful since each time it comes back from suspend or hibernate the value
is set back at 128 so having such a script reset it back to 254 which prevents
the Load_Cycle_Count problem as noted above. 

Hope this help. 

Eric


Comment 5 Dimitrios Apostolou 2012-09-17 09:57:58 UTC
Dear all, may I request that you reopen this bug?

On Fedora 17 I get the following on a 2 year used hdd:

# smartctl -A /dev/sda  | grep ^193
193 Load_Cycle_Count        0x0012   064   064   000    Old_age   Always       -       366975


My hard disk is a Hitachi HTS545025B9A300, and as seen in the datasheet at [1] the expected lifetime is 600K load cycles. So I argue that this *is* a bug for Fedora, and the proper fix would be to "smartctl -B 254" when on AC and "smartctl -B 128" when on battery. I think that's the fix implemented in Debian/Ubuntu, see [2].

[1] http://www.hgst.com/tech/techlib.nsf/products/Travelstar_5K500.B
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=448673


If you are interested I can come up with a patch, it seems pretty simple, as I think the proper place for running hdparm would be "/etc/pm/{power,sleep}.d/, at least to take care of the AC/battery switching. Can someone inform me if these directories are appropriately scanned and executed when systemd boots the system, or different hooks (where?) would be needed for that case?