Bart Samwel wrote:
The line:

  if hdparm -i $dev | grep -q 'AdvancedPM=yes' ; then

is supposed to filter out hard drives that can't handle it.

Apologies, I wasn't using sid, and that line wasn't in the previous version. Now that I've upgraded my acpi-support package, it works fine.

One more thing though: To avoid these messages (since my virtual SCSI drive and my USB drive don't support hdparm -i) ...

# /etc/acpi/start.d/90-hdparm.sh
 HDIO_GET_IDENTITY failed: Invalid argument
 HDIO_GET_IDENTITY failed: Invalid argument

... I'd suggest you apply the attached patch, which discards errors. Then everything works fine!

BTW, why are you running the acpi-support package on a VM?

It's basically a left-over from my previous system, when I copied it over to my VM. I believe I'm now only using acpi-support to get visual feedback when I plug in or unplug the AC adapter. :-) (It also used to spit out low-battery warnings until I stumbled upon an OS X widget that runs on the host and does it in a prettier way.)

Best,

    Lea
--- 90-hdparm.sh~	2008-05-13 03:03:31.000000000 -0400
+++ 90-hdparm.sh	2008-05-18 21:27:30.000000000 -0400
@@ -20,7 +20,9 @@
   AC_POWER=$( /usr/bin/on_ac_power; echo $? )
   for dev in /dev/sd? /dev/hd? ; do
     if [ -b $dev ] ; then
-      if hdparm -i $dev | grep -q 'AdvancedPM=yes' ; then
+      # Check for APM support; discard errors since not all drives
+      # support HDIO_GET_IDENTITY (-i).
+      if hdparm -i $dev 2> /dev/null | grep -q 'AdvancedPM=yes' ; then
 	if [ $AC_POWER -eq 1 ] ; then
 	  hdparm -B 128 $dev
 	else

Reply via email to