Author Topic: Setting APM for my HDD (load_cycle_count issue)  (Read 4136 times)

Offline I_can_see_the_light

  • Full Member
  • ***
  • Posts: 50
    • My blog
Setting APM for my HDD (load_cycle_count issue)
« on: April 18, 2011, 10:25:33 AM »
Hi,

I'm seeing a dramatic increase in "Load_cycle_count" (head parkings) for my hard drive. The drive is about a month old and already the count is 27423 - not good.

Apparently the APM value after boot (on AC) is 128 and values is supposed to be between 1-255. Manually changing this value by using hdparm -B have proved to be a success, I've currently set it to 225 and the counting has actually stopped now. However, looking in the file /etc/laptop-mode/laptop-mode.conf I realize that the value really should be 254 by default (unless I misunderstand something).

Here are some snippets from the above file:
Code: [Select]
ENABLE_LAPTOP_MODE_TOOLS=1
ENABLE_LAPTOP_MODE_ON_BATTERY=1
ENABLE_LAPTOP_MODE_ON_AC=0

CONTROL_HD_IDLE_TIMEOUT=1  # Idle timeout values. (hdparm -S)
LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200

CONTROL_HD_POWERMGMT="auto"  # Power management for HD (hdparm -B values)
BATT_HD_POWERMGMT=1
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254

The way I understand it the variable NOLM_AC_HD_POWERMGMT should set the APM value to 254 since laptop-mode isn't enabled on AC, but as I said earlier the value after boot is actually 128. This obviously means that the value is set somewhere else, the question is where.

I'm using PCLinuxOS KDE and the system is fully updated. Machine specs are in my signature.

Hopefully someone will be able to shed some light on this.
Fujitsu Siemens Lifebook E8020D (tri-booting PCLinuxOS, CrunchBang & Übüntü)
Intel Pentium M (Centrino) 2GHz, 2GB RAM, Seagate Momentus 5400.6 (250GB)
ATI Mobility Radeon X600 64MB
Intel PRO/Wireless 2200BG + Bluetooth

Offline Tuxfriend

  • Hero Member
  • *****
  • Posts: 1256
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #1 on: April 18, 2011, 10:28:14 AM »
Yeah, my HDD in my notebook, when not AC, does lots of 'parkings'. I'll try your suggestion.  ;)
Best regards

Eddie

Offline Tuxfriend

  • Hero Member
  • *****
  • Posts: 1256
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #2 on: April 18, 2011, 10:39:07 AM »
I set BATT_HD_POWERMGMT to 254, with no luck. Still spinning up, down, up, down when not AC.  :'(
Best regards

Eddie

Offline I_can_see_the_light

  • Full Member
  • ***
  • Posts: 50
    • My blog
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #3 on: April 18, 2011, 10:51:30 AM »
I set BATT_HD_POWERMGMT to 254, with no luck. Still spinning up, down, up, down when not AC.  :'(
If your HDD is spinning up and down (starting and stopping) I think the value you should be looking at is the "Idle timeout" value. You don't have to edit the conf-file directly, try chaning the value by issuing the command hdparm -S <value> /dev/sdX
Fujitsu Siemens Lifebook E8020D (tri-booting PCLinuxOS, CrunchBang & Übüntü)
Intel Pentium M (Centrino) 2GHz, 2GB RAM, Seagate Momentus 5400.6 (250GB)
ATI Mobility Radeon X600 64MB
Intel PRO/Wireless 2200BG + Bluetooth

Offline Tuxfriend

  • Hero Member
  • *****
  • Posts: 1256
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #4 on: April 18, 2011, 10:52:00 AM »
I set the timeout to '600'. Will see if that works ...  :D

EDIT: Still no luck. I don't experience the spinning up/down with other distros. Maybe it's something with the kernel?
« Last Edit: April 18, 2011, 10:59:29 AM by Aptenodytes amicus »
Best regards

Eddie

Offline I_can_see_the_light

  • Full Member
  • ***
  • Posts: 50
    • My blog
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #5 on: April 18, 2011, 11:05:04 AM »
@ Aptenodytes amicus

Have a look at this post, it might be the answer to your problem.
Fujitsu Siemens Lifebook E8020D (tri-booting PCLinuxOS, CrunchBang & Übüntü)
Intel Pentium M (Centrino) 2GHz, 2GB RAM, Seagate Momentus 5400.6 (250GB)
ATI Mobility Radeon X600 64MB
Intel PRO/Wireless 2200BG + Bluetooth

Offline Tuxfriend

  • Hero Member
  • *****
  • Posts: 1256
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #6 on: April 18, 2011, 11:14:45 AM »
@ Aptenodytes amicus

Have a look at this post, it might be the answer to your problem.


Thanks for your help, but still no luck.
Best regards

Eddie

Offline Tuxfriend

  • Hero Member
  • *****
  • Posts: 1256
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #7 on: April 18, 2011, 11:20:08 AM »
I removed the laptop mode tools and still got frequent spin-downs.

I think I need a voodoo priest ...  :D
Best regards

Eddie

Offline AS

  • Hero Member
  • *****
  • Posts: 4098
  • Have a nice ... night!
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #8 on: April 18, 2011, 11:53:44 AM »
Hi,

hard disk config parameters for use by hdparm are set up in /etc/sysconfig/harddisks, which are evaluated by the script /etc/rc.sysinit at boot.

Before to tweak with HD parameters, I strongly suggest to check the hard disk specifications provided from the HD producer. Particularly about power management, you should note that at least for laptop an always on is not the best, because of increased power consumption and increased heating.
Only change parameters when you know exactly what you are doing.  ;)

my 2 cents.

AS

Offline I_can_see_the_light

  • Full Member
  • ***
  • Posts: 50
    • My blog
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #9 on: April 18, 2011, 01:39:01 PM »
Hi,

hard disk config parameters for use by hdparm are set up in /etc/sysconfig/harddisks, which are evaluated by the script /etc/rc.sysinit at boot.

Before to tweak with HD parameters, I strongly suggest to check the hard disk specifications provided from the HD producer. Particularly about power management, you should note that at least for laptop an always on is not the best, because of increased power consumption and increased heating.
Only change parameters when you know exactly what you are doing.  ;)

my 2 cents.

AS
Thank you for your reply AS,

Regarding increased heating, I have actually monitored the HDD temperature and it does not seem to rise much, maybe 1-2 degrees C and it's well below max operational temp.

My thoughts on the APM settings are, since I'm mostly running the laptop on AC it could be considered to be a desktop computer. The head parkings are to protect the HDD from bumps and sudden movements, but since it's just sitting on my table it won't protect the hard drive from anything at all. The more parkings the more it will be wore down, most drives are guaranteed to handle 600 000 parkings/unparkings and by my rate I will reach that limit rather quickly. When I replaced my old drive it had sustained about 1 200 000 parkings/unparkings and was still fully functional (but to small to handle a triple boot setup).

As the laptop-mode.conf file suggests the settings should be different when on AC and when running on batteries and that's my view as well.

Just checked /etc/sysconfig/harddisks, I didn't find anything that would set the APM value to 128 so I'm still wondering where that setting came from.

Edit: I'm using the command smartctl -a /dev/sda | egrep '(Load_Cycle_Count|Temperature)' to monitor both temperature and load cycle count.
« Last Edit: April 18, 2011, 02:02:32 PM by I_can_see_the_light »
Fujitsu Siemens Lifebook E8020D (tri-booting PCLinuxOS, CrunchBang & Übüntü)
Intel Pentium M (Centrino) 2GHz, 2GB RAM, Seagate Momentus 5400.6 (250GB)
ATI Mobility Radeon X600 64MB
Intel PRO/Wireless 2200BG + Bluetooth

Offline AS

  • Hero Member
  • *****
  • Posts: 4098
  • Have a nice ... night!
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #10 on: April 18, 2011, 02:33:50 PM »
I did meant to say that you should not change the APM parameters, only to do it correctly: some drive, sometimes, deviates from the ATA standards.

more (a lot of) info here:
http://www.serialata.org/developers/technical_library.asp
http://www.serialata.org/documents/SATA_Power_Management_article_final_04_08_2009.pdf
and of course search for specific info from HD-brand website.

Quote
As the laptop-mode.conf file suggests the settings should be different when on AC and when running on batteries and that's my view as well.

in /etc/laptop-mode/laptop-mode.conf you can tweak the settings for AC and for Battery

Quote
Just checked /etc/sysconfig/harddisks, I didn't find anything that would set the APM value to 128 so I'm still wondering where that setting came from

May be it's set up as default at drive startup directly from the drive ? However once laptop-mode start it will take over with it's own settings.

AS

Offline T6

  • Super Villain
  • ******
  • Posts: 19051
  • xmas is comming!
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #11 on: May 28, 2011, 09:53:41 AM »
this stresses me on the netbook, when on battery it even interrupts the songs playing and when it realizes that the song was in hard disk it spins again  >:(

will test all said here, thanks for the info
"If you wish to make an apple pie from scratch, you must first invent the universe."

Carl Sagan

Offline Tuxfriend

  • Hero Member
  • *****
  • Posts: 1256
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #12 on: May 28, 2011, 10:21:07 AM »
What I do, when on battery - as root, typing in terminal:
hdparm -B 254 /dev/sda

After restarting, you find it in the terminal's history, so it's not such a big deal anymore. But, still, it could be better ...  ;)
Best regards

Eddie

Offline T6

  • Super Villain
  • ******
  • Posts: 19051
  • xmas is comming!
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #13 on: May 28, 2011, 10:31:35 AM »
i just tried that command

konsole replies bad/missing powerup-in-standby values (0..1)

will try with laptop mode tools but i am not that fan of konsole only tools
"If you wish to make an apple pie from scratch, you must first invent the universe."

Carl Sagan

Offline I_can_see_the_light

  • Full Member
  • ***
  • Posts: 50
    • My blog
Re: Setting APM for my HDD (load_cycle_count issue)
« Reply #14 on: May 28, 2011, 11:01:46 AM »
I have managed to solve my own problem by editing /etc/laptop-mode/laptop-mode.conf
The thing that worked for me was to change the variable
CONTROL_HD_POWERMGMT="auto"
to
CONTROL_HD_POWERMGMT="1"


I also changed the APM value to 225
NOLM_AC_HD_POWERMGMT=225
to make the HDD run a little bit cooler.


In my case the problem is solved but I can leave the thread topic open if T6 or Tuxfriend doesn't find a solution.
Fujitsu Siemens Lifebook E8020D (tri-booting PCLinuxOS, CrunchBang & Übüntü)
Intel Pentium M (Centrino) 2GHz, 2GB RAM, Seagate Momentus 5400.6 (250GB)
ATI Mobility Radeon X600 64MB
Intel PRO/Wireless 2200BG + Bluetooth