Announcement

Collapse
No announcement yet.

Lot of cycles Count when on battery

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Lot of cycles Count when on battery

    Hi,
    three weeks ago I'b bought a new laptop and I've installed kubuntu 8.10 amd64. I've seen that when the notebook is not connected to the AC and is working on battery, the numerof hdd cycles grows at a rate of about 1 to 2-3 per minute.

    This is the content of /etc/default/acpi-support:
    Code:
    #                                                                          
    # Configuration file for the acpi-support package                                                  
    #                                                                          
    #                                                                          
    # The acpi-support package is intended as "glue" to make special functions of                                    
    # laptops work. Specifically, it translates special function keys for some                                     
    # laptop models into actions or generic function key presses.                                            
    #                                                                          
    
    
    #
    # Suspend/hibernate method
    # ------------------------
    #             
    # When gnome-power-manager or klaptopdaemon are running, acpi-support will
    # translate the suspend and hibernate keys of laptops into special "suspend"
    # and "hibernate" keys that these daemons handle.              
    #                                      
    # Only in situations where there is no gnome-power-manager or klaptopdaemon 
    # running, acpi-support needs to perform suspend/hibernate in some other way.
    # There are several options for this. The options are:            
    #                                      
    # dbus-pm:                                  
    #  Perform suspend and hibernate actions via a DBUS request to the power  
    #  management daemon. This works for power management daemons that we don't
    #  know of. (For gnome-power-manager and klaptopdaemon this will do nothing,
    #  since those will be detected when they are running, and triggered using 
    #  a virtual keypress.)                           
    #                                       
    # dbus-hal:                                  
    #  Perform suspend and hibernate actions via a DBUS request directly to HAL,
    #  bypassing any running power management daemons.             
    #                                       
    # pm-utils:                                  
    #  Use pm-suspend and pm-hibernate to suspend and hibernate. (The dbus method
    #  normally results in this as well, but calls through dbus. Use this option 
    #  only if you don't have dbus installed.)                  
    #                                       
    # hibernate:                                  
    #  Use the hibernate package to suspend and hibernate.            
    #                                       
    # acpi-support:                                
    #  Use the legacy built-in suspend/hibernate support. (DEPRECATED)      
    #                                       
    # none:                                    
    #  Do not attempt to suspend/hibernate. Set SUSPEND_METHODS="none" to    
    #  disable suspend/hibernate handling in acpi-support.            
    #                                       
    # If you specify dbus or pm-utils, the result will normally be the same as when
    # you suspend from your desktop environment. If you specify "hibernate" or   
    # "acpi-support", be aware that this probably does not match what your desktop 
    # environment would do (unless you have managed to configure something so that 
    # the DBUS power management interfaces call the hibernate package).      
    #                                       
    #                                       
    # Please specify a space separated list of options. The recommended value is  
    # "dbus pm-utils"                               
    #                                       
    SUSPEND_METHODS="dbus-pm dbus-hal pm-utils"                  
    
    
    
    #
    # LEGACY BUILT IN SUSPEND SUPPORT (DEPRECATED)
    # --------------------------------------------
    #                       
    # These options only work for the "acpi-support" suspend method. This is NOT
    # recommended, but is retained for backward compatibility reasons.     
    #                                      
    
    # Comment the next line to disable ACPI suspend to RAM
    ACPI_SLEEP=true                    
    
    # Comment the next line to disable suspend to disk
    ACPI_HIBERNATE=true                
    
    # Change the following to "standby" to use ACPI S1 sleep, rather than S3.
    # This will save less power, but may work on more machines        
    ACPI_SLEEP_MODE=mem                           
    
    # Add modules to this list to have them removed before suspend and reloaded
    # on resume. An example would be MODULES="em8300 yenta_socket"       
    #                                     
    # Note that network cards and USB controllers will automatically be unloaded 
    # unless they're listed in MODULES_WHITELIST                 
    MODULES=""                                  
    
    # Add modules to this list to leave them in the kernel over suspend/resume
    MODULES_WHITELIST=""                           
    
    # Should we save and restore state using the VESA BIOS Extensions?
    SAVE_VBE_STATE=true                        
    
    # The file that we use to save the vbestate
    VBESTATE=/var/lib/acpi-support/vbestate  
    
    # Should we attempt to warm-boot the video hardware on resume?
    POST_VIDEO=true                        
    
    # Save and restore video state?
    # SAVE_VIDEO_PCI_STATE=true  
    
    # Should we switch the screen off with DPMS on suspend?
    USE_DPMS=true                     
    
    # Use Radeontool to switch the screen off? Seems to be needed on some machines
    # RADEON_LIGHT=true                              
    
    # Uncomment the next line to switch away from X and back again after resume.
    # This is needed for some hardware, but should be unnecessary on most.
    # DOUBLE_CONSOLE_SWITCH=true
    
    # Set the following to "platform" if you want to use ACPI to shut down
    # your machine on hibernation
    HIBERNATE_MODE=shutdown
    
    # Comment this out to disable screen locking on resume
    LOCK_SCREEN=true
    
    # Uncomment this line to have DMA disabled before suspend and reenabled
    # afterwards
    # DISABLE_DMA=true
    
    # Uncomment this line to attempt to reset the drive on resume. This seems
    # to be needed for some Sonys
    # RESET_DRIVE=true
    
    # Add services to this list to stop them before suspend and restart them in
    # the resume process.
    STOP_SERVICES=""
    
    # Restart Infra Red services on resume - off by default as it crashes some
    # machines
    RESTART_IRDA=false
    
    # Switch to laptop-mode on battery power - off by default as it causes odd
    # hangs on some machines. (Note: This is reported to cause breakage in
    # Debian - see deb bug #425800. Leaving enabled for Ubuntu for now
    # since presumably it's still valid here.)
    ENABLE_LAPTOP_MODE=false
    
    # Add to this list network interfaces that you don't want to be stopped
    # during suspend (in fact any network interface whose name starts with
    # a prefix given in this list is skipped)
    SKIP_INTERFACES="dummy qemu"
    
    # Note: to enable "laptop mode" (to spin down your hard drive for longer
    # periods of time), install the laptop-mode-tools package and configure
    # it in /etc/laptop-mode/laptop-mode.conf.
    The content of /etc/laptop-mode/laptop-mode.conf is:
    Code:
    ###############################################################################
    #                                       
    # Configuration for Laptop Mode Tools                     
    # -----------------------------------                     
    #                                       
    # There is a "system" to the configuration setting names:           
    #  CONTROL_something=0/1  Determines whether Laptop Mode Tools controls   
    #              something                     
    #  LM_something=value   Value of "something" when laptop mode is active  
    #  NOLM_something=value  Value of "something" when laptop mode is NOT   
    #              active                      
    #  AC_something=value   Value of "something" when the computer is running 
    #              on AC power                    
    #  BATT_something=value  Value of "something when the computer is running 
    #              on battery power                 
    #                                       
    # There can be combinations of LM_/NOLM_ and AC_/BATT_ prefixes, but the    
    # available prefixes are different for each setting. The available ones are  
    # documented in the manual page, laptop-mode.conf(8). If there is no LM_/   
    # NOLM_ in a setting name, then the value is used independently of laptop   
    # mode state, and similarly, if there is no AC_/BATT_, then the value is used 
    # independently of power state.                        
    #                                       
    # Some options only work on ACPI systems. They are marked ACPI-ONLY.      
    #                                       
    # Note that this configuration file is a fragment of shell script: you     
    # can use all the features of the shell scripting language to achieve your   
    # desired configuration.                            
    #                                       
    #                                       
    # Modules                                   
    # -------                                   
    #                                       
    # Laptop Mode Tools modules have separate configuration files, that can be   
    # found in /etc/laptop-mode/conf.d. Please look through these configuration  
    # files as well, there are many useful power saving tools in there!      
    #                                       
    ###############################################################################
    
    
    
    ###############################################################################
    # Configuration debugging                           
    # -----------------------                           
    ###############################################################################
    
    
    #
    # Set this to 1 if you want to see a lot of information when you start/stop 
    # laptop_mode.                               
    #                                      
    VERBOSE_OUTPUT=0                              
    
    
    
    ###############################################################################
    # When to enable laptop mode                          
    # --------------------------                          
    #                                       
    # "Laptop mode" is the mode in which laptop mode tools makes the computer   
    # consume less power. This includes the kernel "laptop_mode" feature, which  
    # allows your hard drives to spin down, as well as various other settings which
    # can be tweaked by laptop mode tools. You can enable or disable all of these 
    # settings using the CONTROL_... options further down in this config file.   
    ###############################################################################
    
    
    #
    # Enable laptop mode when on battery power.
    #                     
    ENABLE_LAPTOP_MODE_ON_BATTERY=1      
    
    
    #
    # Enable laptop mode when on AC power.
    #                   
    ENABLE_LAPTOP_MODE_ON_AC=0      
    
    
    #
    # Enable laptop mode when the laptop's lid is closed, even when we're on AC
    # power? (ACPI-ONLY)                            
    #                                     
    ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0                    
    
    
    
    ###############################################################################
    # When to enable data loss sensitive features                 
    # -------------------------------------------                 
    #                                       
    # When data loss sensitive features are disabled, laptop mode tools acts as if 
    # laptop mode were disabled, for those features only.             
    #                                       
    # Data loss sensitive features include:                    
    # - laptop_mode (i.e., delayed writes)                     
    # - hard drive write cache                           
    #                                       
    # All of the options that follow can be set to 0 in order to prevent laptop  
    # mode tools from using them to stop data loss sensitive features. Use this  
    # when you have a battery that reports the wrong information, that confuses  
    # laptop mode tools.                              
    #                                       
    # Disabling data loss sensitive features is ACPI-ONLY.             
    ###############################################################################
    
    
    #
    # Disable all data loss sensitive features when the battery level (in % of the
    # battery capacity) reaches this value.                    
    #                                       
    MINIMUM_BATTERY_CHARGE_PERCENT=3                       
    
    
    #
    # Disable data loss sensitive features when the battery reports its state
    # as "critical".                             
    #                                    
    DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1             
    
    
    ###############################################################################
    # Controlled hard drives and partitions                    
    # -------------------------------------                    
    #                                       
    # For spinning down your hard drives, laptop mode will remount file systems and
    # adjust hard drive spindown timeouts. These parameters specify which     
    # devices and partitions are affected by laptop mode.             
    ###############################################################################
    
    
    #
    # The drives that laptop mode controls.
    # Separate them by a space, e.g. HD="/dev/hda /dev/hdb". The default is a
    # wildcard, which will get you all your IDE and SCSI/SATA drives.    
    #                                    
    HD="/dev/[hs]d[abcdefgh]"                        
    
    
    #
    # The partitions (or mount points) that laptop mode controls.
    # Separate the values by spaces. Use "auto" to indicate all partitions on drives
    # listed in HD. You can add things to "auto", e.g. "auto /dev/hdc3". You can  
    # also specify mount points, e.g. "/mnt/data".                 
    #                                        
    PARTITIONS="auto /dev/mapper/*"                         
    
    
    #
    # If this is enabled, laptop mode tools will assume that SCSI drives are
    # really SATA drives that only _look_ like SCSI drives, and will use hdparm
    # to control them. Set this to 0 if you have /dev/sd devices and you want 
    # laptop mode tools to use the "sdparm" command to control them.      
    #                                     
    ASSUME_SCSI_IS_SATA=1                           
    
    
    ###############################################################################
    # Hard drive behaviour settings                        
    # -----------------------------                        
    #                                       
    # These settings specify how laptop mode tools will adjust the various     
    # parameters of your hard drives and file systems.               
    ###############################################################################
    
    
    #
    # Maximum time, in seconds, of work that you are prepared to lose when your
    # system crashes or power runs out. This is the maximum time that Laptop Mode
    # will keep unsaved data waiting in memory before spinning up your hard drive.
    #                                       
    LM_BATT_MAX_LOST_WORK_SECONDS=600                       
    LM_AC_MAX_LOST_WORK_SECONDS=360                        
    
    
    #
    # Should laptop mode tools control readahead?
    #                      
    CONTROL_READAHEAD=1             
    
    
    #
    # Read-ahead, in kilobytes. You can spin down the disk while playing MP3/OGG
    # by setting the disk readahead to a reasonable size, e.g. 3072 (3 MB).   
    # Effectively, the disk will read a complete MP3 at once, and will then spin 
    # down while the MP3/OGG is playing. Don't set this too high, because the  
    # readahead is applied to _all_ files that are read from disk.        
    #                                      
    LM_READAHEAD=3072                              
    NOLM_READAHEAD=128                              
    
    
    #
    # Should laptop mode tools add the "noatime" option to the mount options when 
    # laptop mode is enabled?                           
    #                                       
    CONTROL_NOATIME=0                               
    
    # Should laptop use relatime instead of noatime? The "relatime" mount option has
    # more standards-compliant semantics, and allows more applications to work,   
    # while retaining a low level of atime updates (i.e., disk writes).       
    USE_RELATIME=1                                 
    
    
    #
    # Should laptop mode tools control the hard drive idle timeout settings?
    #                                    
    CONTROL_HD_IDLE_TIMEOUT=1                        
    
    
    #
    # Idle timeout values. (hdparm -S)
    # Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
    # for battery and for AC with laptop mode on.                
    #                                      
    LM_AC_HD_IDLE_TIMEOUT_SECONDS=60                       
    LM_BATT_HD_IDLE_TIMEOUT_SECONDS=60                      
    NOLM_HD_IDLE_TIMEOUT_SECONDS=7200                      
    
    
    #
    # Should laptop mode tools control the hard drive power management settings?
    #                                      
    CONTROL_HD_POWERMGMT=1                           
    
    
    #
    # Power management for HD (hdparm -B values)
    #                      
    BATT_HD_POWERMGMT=1             
    LM_AC_HD_POWERMGMT=254           
    NOLM_AC_HD_POWERMGMT=254          
    
    
    #
    # Should laptop mode tools control the hard drive write cache settings?
    #                                   
    CONTROL_HD_WRITECACHE=0                        
    
    
    #
    # Write cache settings for HD (hdparm -W values)
    #                        
    NOLM_AC_HD_WRITECACHE=1             
    NOLM_BATT_HD_WRITECACHE=0            
    LM_HD_WRITECACHE=0               
    
    
    
    
    ###############################################################################
    # Settings you probably don't want to touch                  
    # -----------------------------------------                  
    #                                       
    # It is usually not necessary to change these parameters. They are included  
    # for completeness' sake.                           
    ###############################################################################
    
    
    #
    # Change mount options on partitions in PARTITIONS? You don't really want to
    # disable this. If you do, then your hard drives will probably not spin down
    # anymore.                                 
    #                                      
    CONTROL_MOUNT_OPTIONS=1                           
    
    
    #
    # Dirty synchronous ratio. At this percentage of dirty pages the process
    # which calls write() does its own writeback.              
    #                                    
    LM_DIRTY_RATIO=60                            
    NOLM_DIRTY_RATIO=40                           
    
    
    #
    # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
    # exceeded, the kernel will wake pdflush which will then reduce the amount
    # of dirty memory to dirty_background_ratio. Set this nice and low, so once
    # some writeout has commenced, we do a lot of it.
    #
    LM_DIRTY_BACKGROUND_RATIO=1
    NOLM_DIRTY_BACKGROUND_RATIO=10
    
    
    #
    # kernel default settings -- don't touch these unless you know what you're
    # doing.
    #
    DEF_UPDATE=5
    DEF_XFS_AGE_BUFFER=15
    DEF_XFS_SYNC_INTERVAL=30
    DEF_XFS_BUFD_INTERVAL=1
    DEF_MAX_AGE=30
    
    
    #
    # This must be adjusted manually to the value of HZ in the running kernel
    # on 2.4, until the XFS people change their 2.4 external interfaces to work in
    # centisecs. This can be automated, but it's a work in progress that still
    # needs some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for
    # external interfaces, and that is currently always set to 100. So you don't
    # need to change this on 2.6.
    #
    XFS_HZ=100
    
    
    #
    # Seconds laptop mode has to to wait after the disk goes idle before doing
    # a sync.
    #
    LM_SECONDS_BEFORE_SYNC=2
    Since I don't use the laptop in battery mode frequently, I would like to know if I shoud set ENABLE_LAPTOP_MODE_ON_BATTERY=0 to prevent the hdd to stop.
    Otherwise, how can I avoid the load cycles to increase in battery mode?
    Thank you,
    Xwang

    #2
    Re: Lot of cycles Count when on battery

    Try editing this section:
    #
    # Power management for HD (hdparm -B values)
    #
    BATT_HD_POWERMGMT=1
    LM_AC_HD_POWERMGMT=254
    NOLM_AC_HD_POWERMGMT=254
    And increase the value of 'BATT_HD_POWERMGMT'

    Comment


      #3
      Re: Lot of cycles Count when on battery

      Setting that parameter to 254 can cause problem to the hardware? Consider that when I use the notebook plugged to the AC, the hdd is not hot.
      Xwang

      Comment


        #4
        Re: Lot of cycles Count when on battery

        Originally posted by Xwang
        Setting that parameter to 254 can cause problem to the hardware?
        Not really, but your hdd may draw a bit more battery power.
        (so you can set it to 254 if you like, or test with a lower value to get a load cycle rate that you can accept)

        Comment


          #5
          Re: Lot of cycles Count when on battery

          Hi,
          I've set the value to 254 and I've restarted the pc. Then I've tried to unplug the AC to verify that running on battery the hdd does not execute cycles and his is the result:
          Code:
          andreak@pro5av:~$ sudo smartctl -a /dev/sda | grep Load_Cycle_Count && sleep 300 && sudo smartctl -a /dev/sda | grep Load_Cycle_Count
          193 Load_Cycle_Count    0x0022  100  100  000  Old_age  Always    -    366
          193 Load_Cycle_Count    0x0022  100  100  000  Old_age  Always    -    370
          As you can see in five minutes of normal usage at battery, 4 cycles has been done despite the setting.
          Why? Should I set ENABLE_LAPTOP_MODE=true in /etc/default/acpi-support ?
          Xwang

          Comment


            #6
            Re: Lot of cycles Count when on battery

            Originally posted by Xwang
            Why? Should I set ENABLE_LAPTOP_MODE=true in /etc/default/acpi-support ?
            Yes, didn't notice you still had it disabled, sorry.

            Comment


              #7
              Re: Lot of cycles Count when on battery

              Ok, now it executes one cycle every 5 minutes and I don't understand why since I've set BATT_HD_POWERMGMT to 254. Should I use 255 to disable it definitively?
              Xwang

              Comment


                #8
                Re: Lot of cycles Count when on battery

                Originally posted by Xwang
                Ok, now it executes one cycle every 5 minutes and I don't understand why since I've set BATT_HD_POWERMGMT to 254.
                There is some 'black magic' involved, different hard disk and laptop models can react to the settings differently.

                Should I use 255 to disable it definitively?
                Should be worth a shot, you can test the setting with 'sudo hdparm -B255 /dev/sda'

                You can also try changing the value of 'LM_BATT_HD_IDLE_TIMEOUT_SECONDS' to see if it makes a difference.

                Comment


                  #9
                  Re: Lot of cycles Count when on battery

                  I've set both LM_AC_HD_IDLE_TIMEOUT_SECONDS and LM_BATT_HD_IDLE_TIMEOUT_SECONDS to 600 and it seems that no more cycles are done (and if the disck is in idle for more tha 10 minutes, I prefer it to stop running).
                  So it seems that now is ok!
                  Thank you for your help,
                  Xwang

                  Comment


                    #10
                    Re: Lot of cycles Count when on battery

                    Edit
                    /etc/rc.local
                    and add line
                    hdparm -B 192 /dev/sda

                    Then restart.

                    After this observe cycles count and TEMPERATURE OF YOUR HDD

                    sudo smartctl -a /dev/sda

                    The general rule is that the more you set as -B parameter the less agressive pover management is performed, but hdd temp may increase. But be carefull because for different hdd vendors "don't park head' is 0 for others 254 and for others 255. You have to check it.

                    For me 192 works perfectly. Cycles count increases by one every few hours and hdd temperature didn't change.

                    Comment


                      #11
                      Re: Lot of cycles Count when on battery

                      Originally posted by Kamil_H
                      Edit
                      /etc/rc.local
                      and add line
                      hdparm -B 192 /dev/sda
                      That's not the optimal solution, since the setting may reset after a suspend cycle.

                      Although there are workarounds to make sure the settings are reapplied, enabling laptop mode and setting hd powermanagement settings through it's configuration is somewhat "cleaner". It also allows you to have different settings for AC and Battery.

                      Comment

                      Working...
                      X