2

Some years ago there was a lively discussion about Ubuntu reducing the hard disk lifespan by operating the hard disk in an aggressive power saving mode on default, which causes an excessive number of load cycles.

I've just checked the status on my Xubuntu 14.04 laptop with smartctl -a /dev/sda. Result: 4211 load cycles in 180 hours. When the power adapter is unplugged and the laptop runs on battery, every ~3 seconds a new load cycle happens. This is way too much.

So my question is: Has anything changed since that discussion? What should I do to reduce the frequency of load cycles? Are the old solutions still valid / state of the art?

2 Answers 2

3

As of May 2017, the discussion is still valid, at least for certain types of hard disks and the old solutions are still doing the job. The trick is to set the power management level to less aggressive. On most disks

# hdparm -B /dev/yourdisk

will give you the APM (advanced power management) level currently set. You'll set it by the same command, with actual desired value.

# hdparm -B 254 /dev/yourdisk

Values range from 1 (the most aggressive power saving) to 254 (the least aggressive power saving). Values 128 and less will even allow spindown. 255 will disable APM altogether (not supported by every model). The level depends on the system's category (desktop does not IMHO need any other value than 254, and laptop... well either experiment a little or buy an SSD :)).

On Western Digital it gets more complicated. You either use the WD's utility WDIDLE3.EXE as in this post: https://ubuntuforums.org/showthread.php?t=1565889 or utilize hdparm again, this time with -J option (the specified values are in seconds to park the heads, read about the ranges in hdparm's man page next to -J option). The latter approach is less recommended, and does not work with all their drives.

I highly recommend to read this archlinux wiki page https://wiki.archlinux.org/index.php/hdparm where they discuss also how to make the change with hdparm permanent by making a udev rule in /etc/udev/rules.d/50-hdparm.rules:

ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN+="/usr/bin/hdparm -B 254 -S 0 /dev/sda"
1
  • @azimut Gladly, I presume you already know the answer since then :) Hopefully your question will at least help others - sometimes it is good to make sure whether the old approach is still valid for their problem. Good luck!
    – sulfo
    May 10, 2017 at 14:11
0

Upgrade you RAM, Disable Swap, Period. I Had a 6GB RAM on My Desktop With Swap Enabled, Ubuntu Doesn't use Swap with that amount of RAM until it's needed, My HDD was Sitting down doing nothing.

1
  • The system is not swapping.
    – azimut
    Jun 14, 2014 at 22:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .