HddCycles

This page describes how to check for and fix excessive hard disk drives load/unload cycles count as explained in the Asus UL Series page. Instructions applies to either Ubuntu 9.10 (Karmic Koala) or 10.04 (Lucid Lynx), and may work with other versions.

Check Potential Issue

The smartctl tool is needed to check if a particular hard disk is concerned. It requires the smartmontools package to be installed.

Check procedure:

  1. Go to battery power (unplug the computer from AC power)
  2. Open up a Terminal window (Accessories > Terminal)

  3. Run command:

    sudo smartctl -a /dev/sda | grep Load_Cycle_Count

    which will result in an output like:

    193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       2221
    The last column number (2221 in this example) is the current load/unload cycles count.
  4. Wait 4 minutes
  5. Run the same command again:

    sudo smartctl -a /dev/sda | grep Load_Cycle_Count
  6. The load/unload cycles count should not increase more than 1 cycle every 2 minutes (modern drives are generally rated for about 600.000 cycles, giving about 4 years of lifetime using it 12 hours a day with about 30 cycles per hour). As an example, an Asus UL30A with Hitachi 320 Go drive has been verified with about 4 load/unload cycles per minute with default settings, which should be considered too much.

Fix the Issue

There are notably two different ways to fix that issue. The first one involves using the hdparm tools directly, the other being using Laptop Mode Tools.

IconsPage/IconNote.png Fixing the load/unload cycles count may:

  • Reduce the battery autonomy (the hard disk being kept powered more frequently)
  • Raise the hard disk temperature. This may be checked with the hddtemp tool (requires hddtemp package to be installed):

    sudo hddtemp /dev/sda
    As a general rule, temperature should not go over 39 to 43°C with various hardware.

The Direct Way

The direct way uses hdparm to prevent the hard disk drive from parking too frequently, or from parking at all (1 load/unload cycle per power-on/off or resume cycle) depending on settings values.

IconsPage/IconNote.png Using the direct way will require to disable the Laptop Mode Tools.

Trying the Direct Way

  1. In Gnome Power Manager (System > Preferences > Power manager), uncheck "Spin down Hard Disks when possible" setting in "AC Power" and "Battery" tabs

  2. Deactivate Laptop Mode if enabled: install bum package (Boot-Up Manager), run System > Administration > Boot-Up Manager, find if the "laptop-mode" line is present, uncheck "laptop-mode" (so that it will not be loaded during boot), apply, confirm with "Yes" ("laptop-mode" will be immediately stopped) and quit

  3. Install hdparm package if required

  4. Open up a Terminal window (Accessories > Terminal)

  5. Run

    sudo hdparm -B 254 /dev/sda
  6. Check (on battery power) that the issue is fixed
  7. The 254 value in sudo hdparm -B 254 /dev/sda is extreme and will result in the less aggressive power management setting: very few load/unload cycles, but battery autonomy may be reduced. You may want to tweak this value according to your hardware: as a general rule, values from 192 to 254 are known to give the best results

  8. In case the issue is not fixed, try with:

    sudo hdparm -B 254 -S 242 /dev/sda

    The -S 242 option tells the drive not to spin down before 1 hour (has been observed to be required on some Sony Vaio notebooks).

As an example, with an Asus UL30A, Hitachi 320 Go drive, changes are as follows:

  • Default load/unload cycles were 4 per minute (too much), with about 10 hours of battery autonomy, with Wi-Fi on and a wireless mouse USB dongle.
  • With "-B 254" hdparm setting, load/unload cycles lowers to 1 per power-on/off (or resume) cycle, while battery autonomy goes to about 9 hours in the same conditions. Hard disk drive temperature keeps around 32°C under average use.

Making it Permanent

If the hdparm direct way works, it is needed to make it permanent as settings will be lost at each boot. To do so:

  1. Open up a Terminal window (Accessories > Terminal)

  2. Run

    sudo gedit /etc/pm/power.d/99-hddfix
  3. Paste the following code:

    hdparm -B 254 /dev/sda

    Note that sudo is no more present, as this script will be run by the system with root privileges. You may adapt the "-B 254" value with any better tested value.

  4. Save and close gedit
  5. Make the script executable:

    sudo chmod +x /etc/pm/power.d/99-hddfix
  6. Copy the script to the "resume" location:

    sudo cp /etc/pm/power.d/99-hddfix /etc/pm/sleep.d
  7. Reboot, and do the checking procedure again (on battery power), then try to suspend and/or hibernate, awake the computer and check again.

Laptop Mode Tools

Laptop Mode may also be tweaked to control the hard disk drive power management features to fix this issue.

Instructions and settings relevant to an Asus UL30 model (likely applicable to various hardware) are available in the Asus U/UL Series Launchpad Team mailing-list archive.


Back to Asus UL Series home page

CategoryLaptop

AsusUL/HddCycles (last edited 2010-06-04 10:02:06 by ip-163-225)