Wednesday, March 16, 2011

How to fix hibernate resume in latitude x300 ubuntu karmic

Recently I had problems with one of the main feature I use on my laptop: hibernation.

My old latitude x300 does not resume after a good hibernation !!! 
After a period of debugging  I can conclude that the reason (which I was not able to heal) is that the swap image of the hibernation was not found from its flag so I decided to use pm-hibernate passing resume=/dev/xxx as a kernel flag:
  • add resume=/dev/xxx in your grub menu as a kernel option where xxx is the device where you have your swap partition that you can find as follows:
cat /proc/swaps 
Filename Type Size Used Priority
/dev/sda5                               partition 1959888 0 -1

usually this solve the problem, if not it's a bigger one ;) but anyway I have a workaround as usual quick and dirty one:
  • install hibernate package: sudo apt-get install hibernate
  • modify as follows the hal file corresponding to the hibernation : /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux
from:
# We only support pm-tools 
if [ -x /usr/sbin/pm-hibernate ] ; then
  /usr/sbin/pm-hibernate $QUIRKS
  RET=$?
else
        unsupported
fi

to:
 
# We only support hibernate since pm-tools not resuming
if [ -x /usr/sbin/hibernate ] ; then
        /usr/sbin/hibernate --force
        RET=$?
elif [ -x /usr/sbin/pm-hibernate ] ; then
  /usr/sbin/pm-hibernate $QUIRKS
  RET=$?
else
        unsupported
fi

  • stop and start hal : sudo service hal stop ; sudo service hal start

No comments:

Post a Comment