March 10, 2008 · General · Email This Post

Sponsored Link
You might have noticed that the suspend and hibernation function in ubuntu/kubuntu won’t work. While there’s no official fix, you might find this work around helpful.

Most people need hibernation for their laptops.step is to install a tool called «uswsusp»

sudo apt-get install uswsusp

And by typing the below command you check if the suspend function works now….

sudo s2ram

Same goes for hibernation

sudo s2disk

Now once this is done, and all of the above commands work, they can be replaced with the old non-working commands that come with ubuntu.

But attention, before editing the system files, always make sure you back up the files in case something goes completely wrong.

sudo cp /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux.bak

sudo cp /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux.bak

This step is to replace the old commands with the new commands in

hal-system-power-suspend-linux

sudo nano /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux

paste the following:

#!/bin/sh
/sbin/s2ram –force

hal-system-power-hibernate-linux

sudo nano /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux

paste the following again:

#!/bin/sh
/sbin/s2disk

Sponsored Link

Incoming search terms:

Related posts

69 Comments to “Fix for suspend and hibernation problem for Laptops”

  1. Femacamper says:

    I get a crash on rebooting from hibernate after doing this…I have to reboot again with previous successful boot, and then it works.

    Is there any way to skip the crash?

    [Reply]

  2. Mike Lopez says:

    instead of using uswsusp, i used the acpi scripts /etc/acpi/sleep.sh and /etc/acpi/hibernate.sh. works for me. :)

    [Reply]

  3. Rangga says:

    Oh. Dear Lord, why the command so long. Is it possible that ubuntu will fix this bug via update?

    [Reply]

  4. Subhrajit says:

    In my case, the location of s2ram and s2disk was in /usr/sbin, instead of /sbin.

    [Reply]

  5. Ole says:

    On my Dell Latitude X300, I’ve found that it’s closing the lid that causes problems, not suspend. If I press the alt-esc, the computer suspends and comes back alive fine. But if I close the lid, which I’ve also set to suspend, it crashes. I tried setting the “close lid” to blank screen and also tried hibernate, and the computer crashed in both instances.

    [Reply]

  6. dennis j says:

    With Ubuntu 9.10, I have to change the /etc/pm/config.d/00sleep_module file to make power manager use uswsusp.

    # The sleep/wake system to use. Valid values are:
    # kernel The built-in kernel suspend/resume support.
    # Use this if nothing else is supported on your system.
    # uswsusp If your system has support for the userspace
    # suspend programs (s2ram/s2disk/s2both), then use this.
    # tuxonice If your system has support for tuxonice, use this.
    #
    # The system defaults to “kernel” if this is commented out.
    SLEEP_MODULE=”uswsusp”

    [Reply]

  7. Jorge Gustavo says:

    Since 9.10, I was unable to use uswsusp, simple because my computer no longer boots if ‘resume’ is present in kernel options. Either it takes too long or it doesn’t boot al all. But I glad the dennis j is able to use uswsusp in Ubuntu 9.10.

    [Reply]

  8. Gus says:

    If I disable display effects then suspend works normally!!

    3-4 y/o Dell inspiron 6000 laptop 2g ram

    [Reply]

  9. Jaime says:

    I have the same problem with the lid of the Dell Latitude X300. The computer hangs when you close the lid. Help anyone? Thanks!

    [Reply]

  10. MK says:

    thanks, works a treat.

    [Reply]

  11. Mitja says:

    I’m a noob. I have the same problem with the lid.
    Found this thoe:

    http://www.linux.com/news/hardware/laptops/8253-how-to-suspend-and-hibernate-a-laptop-under-linux

    I’m gonna go through with it tomorrow because it’s time for me to call my s2ram script. :-)

    [Reply]

  12. cmcanulty says:

    I tried this and still on suspend screen goes dark for a few seconds then comes back fully on. Hibernate works normally though. When I had this laptop with XP standby and hibernate worked normally. Hopefully the suspend problem will be fixed soon as we all need to save energy.

    [Reply]

  13. Thusitha says:

    thank you very much. This did work for me. The suspend option had to be invoked as sudo s2ram -f
    Both suspend and hibernate are better than the default ones :)

    Btw if anybody knows how to integrate a splash to the hibernate please let me know.
    thnaks again.

    [Reply]

  14. Steve says:

    Is this going to be fixed for the Ubuntu 10.04 release?

    [Reply]

  15. I have started using Ubuntu 10.04 and I have the same problem. My Toshiba Laptop/Tablet PC, always freezes when put in suspend or hibernate mode.

    After sudo apt-get install uswsusp when I enter sudo s2ram I get following message:

    Machine is unknown.
    This machine can be identified by:
    sys_vendor = “TOSHIBA”
    sys_product = “Satellite R20″
    sys_version = “PSR20U-00T009″
    bios_version = “Version 1.30″
    See http://suspend.sf.net/s2ram-support.html for details.
    How do I find out whether suspend function works?

    [Reply]

  16. Andreas says:

    My machine (Clevo TN70M) isn’t identified too – just try “sudo s2ram -f” instead. That works for me.

    [Reply]

  17. Andreas says:

    I mean “-force”… ;)

    [Reply]

  18. This is what I get
    sudo: s2ram-force: command not found

    [Reply]

  19. //VVV says:

    Thanks.

    With –force options works great with my Samsung N150 and Ubuntu 10.04 (standard suspend/hibernate does not work due to bug).

    [Reply]

  20. kristiang says:

    I’m using the new Ubuntu 10.04 and the same problem with a Lenovo G530. But after installed the uswsusp, now all is working with the commands sudo s2ram -f and sudo s2disk. Thanks for the author!

    [Reply]

  21. kristiang says:

    one question, have a way to the user password be requested when the image is restored from hibernation?

    [Reply]

  22. tavin says:

    It did the Job for my Dell Studio 15 (bought 2010)!

    I needed to reinstall the properitary ati driver, but I’m not sure if that’s an related error

    [Reply]

  23. SF says:

    I have the same problem running Ubuntu 10.04 64 bit on a Dell Latitude e6510.

    However!

    Running 32 bit Ubuntu 10.04 on a Lenovo R61i works perfectly, even with Virtualbox installed and with a virtual host running…. strange…

    [Reply]

  24. Thomas Edwards says:

    Thanks a lot, works perfectly! I used sudo s2ram -f to get it working with my laptop.

    For those who are a bit confused with the last step, to edit the sleep script:

    sudo gedit /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux

    Then replace all the text with just this:

    #!/bin/sh
    /sbin/s2ram –force

    Then to edit the hibernate script:

    sudo gedit /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux

    Then replace all the text with this:

    #!/bin/sh
    /sbin/s2disk

    [Reply]

  25. Cferron says:

    I was able to install the package successfully.
    After I ran “sudo s2ram” laptop went to sleep.

    Unable to wake it from sleep (even by pushing the power button once). Screen stays blank.

    Now the WORST part.

    When I tried to reboot my computer it asked me for a password (the bios)!!!!???? WTF???? I have never put a password in there!

    Any idea what I could do now? My laptop is useless!!!!

    Toshiba A100 laptop (model #PSAAKC-VA104C).

    PLEASE HELP!!!

    [Reply]

  26. panoet says:

    Thanks, for the info :)

    [Reply]

  27. Cferron says:

    Little update on my situation.

    It turns out that the fact the BIOS got a password automatically set is a BUG with the version that I had. Toshiba serviced the computer, that part is fixed now. This was a coincidence then.

    So I got back the computer and I try the “sudo s2ram” command again… Still no luck for me on this side :(
    - I have to push the power button to wake from sleep, but still the screen stays blank and nothing happen.
    - I have to hold the power button in order to shutdown the computer.
    - When I boot it again… It won’t boot! It stays at the Toshiba main screen and the Booting sequence stall. I have to remove the RAM and put it back it in order to have the machine to boot.
    - I have tested the memory with memtest and all test passed.

    I guess I will not put the computer to sleep until another solution arise.

    Claude

    [Reply]

  28. Sasha says:

    Have the same issue. Msi 670 M laptop when I install uswsusp I can put the laptop nto slep, but can not awake it. Had to restart.

    [Reply]

  29. Barbara says:

    Hi, thanks for the help, however, I got a bit lost. Seems like more people have a similar problem.

    I installed uswsusp, then ran the commands – sudo s2ram -n gave me a description of the machine, while the other two options (s2ram and s2ram -f) made the system go to sleep. Then it wouldn’t wake up and I had to reboot.

    Any idea?

    (Acer TM 2450, running lucid)

    [Reply]

  30. busymind says:

    touch /etc/acpi/lidsuspend-acustom.sh
    nano /etc/acpi/lidsuspend-acustom.sh

    insert

    #!/bin/sh
    /usr/sbin/s2ram

    nano /etc/acpi/events/lidbtn

    #——————————————–
    # /etc/acpi/events/lidbtn
    # Called when the user closes or opens the lid

    event=button[ /]lid
    #action=/etc/acpi/lid.sh # —————->>>> comment out
    action=/etc/acpi/lidsuspend-acustom.sh # –>>insert this
    Save and reboot or restart acpi

    [Reply]

Leave a Reply