[Bug 738757] Re: spindown settings lost on pm-suspend indirectly affects powernap power savings

Bazon bazonbloch at arcor.de
Sun Sep 30 10:42:45 UTC 2012


I have an at least similar issue on 12.10 quantal:
 I want to spin down my external USB drive /dev/sdc as fast as possible:
in /etc/hdparm.conf:

/dev/sdc {
	spindown_time = 1
}

that works, although I get

$ sudo hdparm -C /dev/sdc
/dev/sdc:
SG_IO: bad/missing sense data, sb[]:  f0 00 01 00 50 40 00 0a 00 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 drive state is:  unknown

but after resume from suspend, it doesn't work anymore.

my workaround is
/etc/pm/sleep.d/20-hdparm

#!/bin/bash
case "$1" in
	thaw|resume)
		hdparm -S 1 /dev/sdc
		;;

esac

and that works, anyway, spindown settings shouldn't get lost on
suspend/resume in the first place.


So what is most reasonable? 
 * Reopen this bug?
 * Deal with that issue in the similar and open bug https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/199094 ?
 * Open a new bug?

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to hdparm in Ubuntu.
https://bugs.launchpad.net/bugs/738757

Title:
  spindown settings lost on pm-suspend indirectly affects powernap power
  savings

Status in “hdparm” package in Ubuntu:
  Fix Released
Status in “pm-utils” package in Ubuntu:
  Invalid

Bug description:
  Binary package hint: hdparm

  Upon wakeup from pm-suspend, all spindown settings on drives as set in
  hdparm.conf are lost and drives will not spindown until reboot.

  This will affect the performance of such useful packages such as
  powernap, since drives will not enter spindown after the first time a
  system is suspended and then resumed.  Power will be wasted, watts
  that could be saved will be lost!!!

  Upon investigation I found that a similar problem has been found and
  fixed for APM settings by use of the script /usr/lib/pm-utils/power.d
  /95hdparm-apm, which restores '-B' APM hdparm settings on capable
  drives following power events if laptop-mode-tools are not installed.

  Since laptop-mode-tools is not a suitable package for a server
  environment, it is important the hdparm provide a similar script for
  spindown.  Indeed, hdparms has already set the precedent that it
  should provide such backstop functionality as part of the package to
  support pm-utils functionality for critical drive parameters.

  I have prepared a patch file that is more or less a clone of the
  script used for the APM functionality, but which restores the '-S'
  spindown hdparm parameters.  I suggest that it be placed in /usr/lib
  /pm-utils/sleep.d/95hdparm-spindown.  I kept the hdparm-try-apm test
  so that it will not apply to USB or firewire drives, and also kept the
  logic so that is applied only on drives that support APM (figured that
  test wouldn't hurt and might be important).  I assumed it would not
  apply in pm-powersave and so moved it from power.d/ to sleep.d/.

  As a side note, I also have a patch I am submitting to powernap to
  extend functionality to add a monitor plugin that will key off drive
  standby/sleep state.  The patch will only work, however, if the drives
  spindown more than once per boot...

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/738757/+subscriptions




More information about the foundations-bugs mailing list