I would like to understand why SMART is reporting my HGST hard drive's load cycle count raw value as increasing, and if there is anything I should do to minimize this to extend the life of my hard drive.
I'm running Debian Jessie on my laptop, and I've been plugged-into A/C power for the past several hours. I have smartctl installed:
# apt-get install smartmontools
My hard drive is an HGST Travelstar:
$ sudo smartctl -a /dev/sda
...
Model Family: HGST Travelstar 7K1000
Device Model: HGST HTS721010A9E630
...
I have a script periodically capturing some stats of interest:
9 Power_On_Hours 0x0012 089 089 000 Old_age Always - 5236
12 Power_Cycle_Count 0x0032 099 099 000 Old_age Always - 1598
193 Load_Cycle_Count 0x0012 070 070 000 Old_age Always - 305107
My script is grabbing these values and storing them in a file so I can plot them over time with gnuplot:
Timestamp,PowerOnHoursValue,PowerOnHoursRawValue,PowerOnHoursWorst,PowerOnHoursThreshold,PowerCycleCountValue,PowerCycleCountRawValue,PowerCycleCountWorst,PowerCycleCountThreshold,LoadCycleCountValue,LoadCycleCountRawValue,LoadCycleCountWorst,LoadCycleCountThreshold
2017-06-10T11:02:18,089,5235,089,000,099,1598,099,000,070,304747,070,000
2017-06-10T11:17:01,089,5235,089,000,099,1598,099,000,070,304795,070,000
2017-06-10T12:17:01,089,5236,089,000,099,1598,099,000,070,305195,070,000
2017-06-10T12:27:03,089,5236,089,000,099,1598,099,000,070,305304,070,000
I have no cmd_line
option set in my /etc/hdparm.conf
file setting the hdparm
option to configure the spin-down time; nor do I have any -e apm
option set in my /etc/smartd.conf
file.
I'm running MATE but I'm not sure if it has any configuration options set for the spin-down time other than the Spin down hard disks when possible checkbox under System > Preferences > Power Management. (By the way, it's currently unchecked when On AC Power and checked when On Battery Power.
From around 11:05 a.m. till around 12:00 p.m. I left my laptop alone but did not put it into standby or sleep; it was still on with the screen locked.
At 12:00 p.m. I started using it again and have been at the keyboard till 12:27 p.m.
Here are my current APM settings:
$ sudo smartctl --get=apm /dev/sda
...
APM level is: 128 (minimum power consumption without standby)
$ sudo hdparm -I /dev/sda | grep level
Advanced power management level: 128
$ sudo hdparm -B /dev/sda
/dev/sda:
APM_level = 128
Per the description of the -S
option to hdparm
, 128 means the standby (spindown) timeout for the drive is 128*5=640 seconds, or just over 10 minutes, if I understood this correctly.
Update: I disabled APM on the drive by editing my /etc/smartd.conf
and changing -e apm,241
to -e apm,off
, and then restarting smartmontools.
This looks like it helped stop the increase:
Timestamp,PowerOnHoursValue,PowerOnHoursRawValue,PowerOnHoursWorst,PowerOnHoursThreshold,PowerCycleCountValue,PowerCycleCountRawValue,PowerCycleCountWorst,PowerCycleCountThreshold,LoadCycleCountValue,LoadCycleCountRawValue,LoadCycleCountWorst,LoadCycleCountThreshold
2017-06-10T11:02:18,089,5235,089,000,099,1598,099,000,070,304747,070,000
2017-06-10T11:17:01,089,5235,089,000,099,1598,099,000,070,304795,070,000
2017-06-10T12:17:01,089,5236,089,000,099,1598,099,000,070,305195,070,000
2017-06-10T12:27:03,089,5236,089,000,099,1598,099,000,070,305304,070,000
2017-06-10T13:17:01,089,5237,089,000,099,1598,099,000,070,305585,070,000
2017-06-10T14:17:01,089,5238,089,000,099,1599,099,000,070,305864,070,000
2017-06-10T14:59:17,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T14:59:24,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:00:05,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:01:06,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:02:08,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:03:09,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:04:10,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:05:11,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:05:26,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:15:27,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:17:01,089,5238,089,000,099,1600,099,000,070,305868,070,000
If no one has any better ideas, the next thing I can try is playing around with the 241 value to see how that makes a difference. According to the hdparm
man page:
- 0: timeouts are disabled
- 1..240: multiples of 5 seconds, yielding timeouts 5s..20m
- 241..251: 1..11 units of 30 minutes, yielding timeouts 30m..5.5h
- 252: 21-minute timeout
- 253: vendor-defined timeout period 8h..12h
- 254: reserved
- 255: 21-min plus 15-sec
I wanted 241 for my laptop specifically for a 30-minute timeout, so I would expect the load cycle count to increment by 1 no less than every 30 minutes; however, it appears I was seeing counts increase 300-400 times per hour before I disabled APM, which would average to 5-7 times per minute, or once every 8-12 seconds.
Please correct me if I'm interpreting these incorrectly.
Update: I just picked up the laptop and took it out of Suspend. In the last update, I never examined the APM level after restarting smartmontools
. I'll do that this time.
Since coming out of Suspend, I noticed my cycle count only increased by 1 this time since my laptop went into Suspend and now came out of Suspend:
...
2017-06-10T15:17:01,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:25:28,089,5238,089,000,099,1600,099,000,070,305868,070,000
2017-06-10T15:35:29,089,5239,089,000,099,1600,099,000,070,305868,070,000
2017-06-11T00:56:09,089,5239,089,000,099,1601,099,000,070,305869,070,000
2017-06-11T01:04:24,089,5239,089,000,099,1601,099,000,070,305869,070,000
...
What's funny is now it kept increasing again:
...
2017-06-11T01:04:24,089,5239,089,000,099,1601,099,000,070,305869,070,000
2017-06-11T01:14:25,089,5239,089,000,099,1601,099,000,070,305918,070,000
2017-06-11T01:17:01,089,5239,089,000,099,1601,099,000,070,305918,070,000
2017-06-11T01:21:35,089,5239,089,000,099,1601,099,000,070,305918,070,000
2017-06-11T01:24:26,089,5239,089,000,099,1601,099,000,070,305918,070,000
2017-06-11T01:33:48,089,5239,089,000,099,1601,099,000,070,305963,070,000
I checked the APM level and it's back to 128:
$ sudo hdparm -I /dev/sda | grep level
Advanced power management level: 128
$ sudo smartctl --get=apm /dev/sda
...
APM level is: 128 (minimum power consumption without standby)
$ sudo hdparm -B /dev/sda
/dev/sda:
APM_level = 128
My /etc/smartd.conf
settings still specified -e apm,off
so I simply restarted smartmontools
and then checked the APM level again:
$ sudo service smartmontools restart
$ sudo smartctl --get=apm /dev/sda
...
APM feature is: Disabled
$ sudo hdparm -I /dev/sda | grep level
Advanced power management level: disabled
$ sudo hdparm -B /dev/sda
/dev/sda:
APM_level = off
I purposely put the laptop into Suspend again and took it back out. I checked the APM level and it was 128 again just like above; when I restarted smartmontools
, the APM level again was disabled just like above.
Again my cycle count is holding after disabling APM:
...
2017-06-11T01:33:48,089,5239,089,000,099,1601,099,000,070,305963,070,000
2017-06-11T01:34:27,089,5239,089,000,099,1601,099,000,070,305971,070,000
2017-06-11T01:42:06,089,5239,089,000,099,1601,099,000,070,306048,070,000
2017-06-11T01:42:58,089,5239,089,000,099,1602,099,000,070,306050,070,000
2017-06-11T01:43:24,089,5239,089,000,099,1602,099,000,070,306050,070,000
2017-06-11T01:44:32,089,5239,089,000,099,1602,099,000,070,306050,070,000
2017-06-11T01:45:00,089,5239,089,000,099,1602,099,000,070,306050,070,000
Following information in Bug #1248012, I tried enabling the APM options in /etc/hdparm.conf
:
...
# -B apm setting
#apm = 255
apm = 255
# -B apm setting when on battery
#apm_battery = 127
apm_battery = 255
...
I restarted hdparm
:
$ sudo /etc/init.d/hdparm restart
After putting the hard drive into Suspend and bringing it back out, I noticed the APM level is back to 128.
I opened Question #1218107 for this.
Best Answer
These values you got from
man hdparm
apply to-S
option – spin-down, making platters stop rotating.My quick research indicates that
Load_Cycle_Count
is connected to parking heads and it seems the-B
option (Advanced Power Management, APM) is the right one. The description in the man page is not perfectly clear to me but your value of128
is the most aggressive one that doesn't permit spin-down. My guess is it parks the heads most often.You calculate a spin-down time from this value of
128
using the description of-S
and I think it's wrong. This calculation confuses-B
and-S
. The same confusion occurs when you set APM to241
.I've seen claims that
hdparm -B 255 /dev/sdX
helps. It disables Advanced Power Management though. My disk is set to254
and it has what I think is a moderateLoad_Cycle_Count
with respect toPower_On_Hours
: 200k and 20k respectively, so the ratio is way better than yours.My advice is to use one of the following:
I guess if you set
-B
to a value that permits spin-down (i.e127
or less) then you should also adjust-S
option to get not-too-short spin-down time. This is because every spin-down requires heads to be parked.While
man hdparm
warns about various dangerous options,-B
is not among them. Even if I'm completely wrong it should be safe to experiment.