Fixing software suspend / hibernate with uswsusp in Ubuntu Feisty (and Edgy)

After upgrading to Feisty, my new favorite feature suspend-to-disk (aka hibernate) was broken badly; basically, the resume would never be found, so it’d act as if it had a corrupted swap partition and unmounted disks. A lot of people share my grief, suspend is a notoriously tricky thing to nail down because of bad drivers, companies who won’t cooperate with kernel developers, and the fact that software suspend itself is tricky business.

However, after a ton of investigation, it appears there is another solution to the standard one shipped with Ubuntu in µswsusp, which is a different method of suspending to disk. It turns out after some research, that the kernel method works for some people and µswsusp works better for others. If you’re having trouble with the former, here we go (this is written for Feisty Fawn, but most of the stuff works for Edgy):

How to try uswsusp

Before we set it to be the default, we want to try it out to make sure that it works for your laptop. First, make sure you’re running Feisty Fawn, then from the terminal type:

Code Sample:

sudo apt-get install uswsusp
sudo s2disk        ## CAUTION: make sure data is saved for this test!

Making uswsusp the default in Ubuntu

If it worked, hurrah! Now, to make this the default way to hibernate/suspend the computer (including the logout dialog, and GNOME Power Manager) involves some hackery but it’s not too bad, and it’s not likely to cause any problems. Download these two files:

Then run the following command in the Terminal:

Code Sample:

sudo cp hal-system-* /usr/lib/hal/scripts/linux/
sudo chmod 755 /usr/lib/hal/scripts/linux/*

Note that for Edgy, the scripts are named differently and are in /usr/share/hal/scripts

Technical details of what that does

When HAL is given the command to shutdown by gnome-panel or by g-p-m, it ends up executing these scripts, which end up going through a list of files trying to find some command to shut the machine down. The first command it usually finds is pmi, which invokes the kernel hibernate code. My file rearranges the priority so that s2disk/s2ram is called instead (and also corrects a dumb bug where it had the wrong path coded in the file). Since most all userspace requests now go through HAL to shut the machine down, this has the convenient effect of fixing hibernate for everything. Yahtzee!

Update: It appears bcm43xx (Broadcom Wireless driver) and uswsusp really don’t get along; use ndiswrapper instead. I also switched to the native ati driver instead of fglrx, but the latter still might work, I haven’t tried it.

Web 2.0, Go! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • co.mments
  • del.icio.us
  • digg
  • Reddit
  • Shadows
  • YahooMyWeb

122 Comments »

  1. Ralph said,

    February 13, 2007 @ 5:31 pm

    Hibernate never ever worked for me in ubuntu. Now I gave uswsusp a try and it works fine. Many thanks for that hint!!

    Just curious how many people do have the same problem. maybe switching over to this method would be a better step.

  2. Tobi said,

    March 3, 2007 @ 9:38 am

    Very nice solution, thanks! When I first upgraded to Feisty, STD and STR were working allright. But somehow, they got lost on the way to Feisty Herd 5.

    s2ram still won’t work. It claims my machine was “unknown”. But I don’t use it anyway.

  3. its about time» Blog Archive » links for 2007-03-05 said,

    March 5, 2007 @ 6:34 pm

    […] Fixing software suspend / hibernate with uswsusp in Ubuntu Feisty (and Edgy) » Thursday Night Its a tricky thing…hoping it works for my acer aspire! (tags: hibernate suspend ubuntu linux) […]

  4. Robin Battey said,

    March 16, 2007 @ 9:27 pm

    Modifying file in /usr always gets you in trouble when the package is updated -- the update overwrites the files, reverting your manual changes, and it doesn’t even have the decency to make a backup. The scripts above are provided by the “hal” package, so any updates to the “hal” package will kill your script changes.

    A better solution would be to uninstall the powermangement-interface package, which provides the /usr/sbin/pmi binary. Then, uswsusp is the first thing those hal scripts will find (assuming you’ve already installed uswsusp and haven’t installed powersave or suspend2, which are checked first). This has the added bonus of not reverting your changes by an update.

    Unfortunately, that would also uninstall the ubuntu-desktop meta-package, which means your updates would have strange failures in the future. (Ubuntu maintainers change package dependencies of the ubuntu-desktop package to make distro upgrades easier.) So, uninstalling the package itself isn’t such a viable option. This is probably a bug in ubuntu that it requires that specific power management interface.

    Luckily, there is the incredibly useful but almost unknown utility called dpkg-divert which is installed on every Debian and Ubuntu system as part of the package management system. This utility allows you to move files using the package management system, and have those changes *persist across updates*. In essence, it adds a config line somewhere saying “whenever you want , use instead. Using this, we can move /usr/sbin/pmi to another location, such as /usr/sbin/pmi-disabled, causing the acpi-support scripts *not* to find it. Updates will also put the *new* versions of the /usr/sbin/pmi to the /usr/sbin/pmi-disabled location, keeping your changes intact.

    So, the howto above can be shortened to in instruction to run the following two lines:

    sudo apt-get install uswsusp
    sudo dpkg-divert --rename --divert /usr/sbin/pmi-disabled /usr/sbin/pmi

    That’s all you need, and uswsusp is now installed and the default -- assuming you haven’t installed any other hibernation software. Optionally, if you want the spiffy splash screens during hibernate/restore, also install the splashy and splashy themes (you’ll have to edit /etc/uswsusp.conf and add a line saying “splash = y” to use them):

    sudo apt-get install splashy splashy-themes

    If, for some reason, you want to remove the dpkg diversion and start using /usr/sbin/pmi for hibernation again, you would do that with the following command:

    sudo dpkg-divert --rename --remove /usr/sbin/pmi

    The best part of all this is, you’ll only have to do this once, and not once every time the hal package is updated.

    Cheers!
    -robin

  5. snowpunk98 said,

    March 20, 2007 @ 1:03 pm

    I will give this a try on my Dell E1705 and hopefully it fixes the problem for me. My laptop uses a Broadcom bcm43xx driver but I am using ndiswrapper, so ill be OK right?

  6. pjotre said,

    March 30, 2007 @ 7:10 am

    Hi!

    I tried to set up uswsusp as described in the comment by Robin Battey, but I only get s2ram to work if I force it (s2ram -f). This works perfectly on my nx6310.

    My problem is, that I don’t know what to do in order to always force s2ram. Now I can only do it manually using a terminal…

    Which scripts do I have to change?

    Thanx for your help

  7. Paul Betts said,

    March 30, 2007 @ 2:00 pm

    pjotre: Edit the scripts I mention; they’re just Bash scripts, you can change them any way you want. However, I’d investigate why you need the -f switch in the first place (”What does -f do differently? What on my machine is preventing normal s2ram to work?”)

  8. pjotre said,

    April 1, 2007 @ 2:16 am

    thanx for your help, I’ll try that…
    -f is required if your notebook is not in the whitelist. In that case s2ram won’t work at all if not being forced.

  9. moses said,

    April 12, 2007 @ 5:25 pm

    Thanks for this - hibernate now works for me… btw - bcm43xx works for me after resume, but I need to tell network-manager to reconnect though.

  10. ltmon said,

    April 12, 2007 @ 8:45 pm

    This works fine with s2ram for me, where as kernel based suspend didn’t. Thanks a lot for the help.

    s2disk however is more of a problem. It seems to suspend fine, but it will not resume. My /var/log/kern shows:

    > swsusp: Resume From Partition swap:/dev/sda1
    > PM: Checking swsusp image.
    > swsusp: Error -6 check for resume file

    Anyone know what’s going wrong here?

  11. Paul Betts said,

    April 12, 2007 @ 8:50 pm

    There’s two things that come to mind:

    1. Is your swap partition on /dev/sda1? Is that the swap partition that s2disk is saving to?

    2. Feisty started using the SCSI framework for ATA, which means that all the hda’s in your config files are now wrong - grep /etc/ for /dev/hda and see if any of the files are incorrect

  12. ltmon said,

    April 13, 2007 @ 10:05 pm

    1. /dev/sda seems to be fine:

    > swapon -s
    > Filename Type Size Used Priority
    > /dev/sda1 partition 1052248 0 -1

    2. I’ve always had /dev/sda* devices, and haven’t had to worry about this change. In any case I can’t find anything indicating this problem in /etc. I did a dpkg-reconfigure on uswsusp to get it to work in the first place, which I believe found my swap partition correctly and configured everything.

    Thanks in any case,

    L.

  13. jay said,

    April 16, 2007 @ 6:40 am

    thank you

    http://ubuntuforums.org/showthread.php?p=2461650#post2461650

  14. calvin said,

    April 20, 2007 @ 12:12 pm

    I’m using Edgy and get the following error message when the second line of Robin Battery’s (March 16th) two lines commands are run

    dpkg-divert: --add needs a single argument

    Any thoughts?

  15. Niels said,

    April 21, 2007 @ 6:53 am

    > dpkg-divert: –add needs a single argument
    >
    > Any thoughts?

    sudo dpkg-divert --add --rename --divert /usr/sbin/pmi-disabled /usr/sbin/pmi

  16. Paul Betts said,

    April 21, 2007 @ 9:48 am

    Where did you guys get the ‘--add’ from, it only says ‘--rename --divert’?

  17. Chris Ian Fiel said,

    April 21, 2007 @ 12:29 pm

    When I tried to issue this command
    ian@ian-desktop:~/Desktop$ sudo dpkg-divert –rename –divert /usr/sbin/pmi-disabled /usr/sbin/pmi
    dpkg-divert: --add needs a single argument

    this is the output.

    how can i resolve this issue? Thanks in advance.

  18. Paul Betts said,

    April 21, 2007 @ 12:33 pm

    Retype it, making sure that the dashes come out as the right character - Wordpress replaces ‘dash dash’ with a funny long dash. Annoying.

  19. Chris Ian Fiel said,

    April 21, 2007 @ 7:27 pm

    Thanks paul its works flawlessly. linux rocks! :)

  20. Chris Ian Fiel said,

    April 21, 2007 @ 7:59 pm

    It work flawlessly with hibernate but when i tried the suspend it does not work so i tried to run it in the console. sudo ./hal-system-power-suspend-linux and this is the output

    Machine is unknown.
    This machine can be identified by:
    sys_vendor = ” ”
    sys_product = ” ”
    sys_version = ” ”
    bios_version = “6.00 PG”
    See http://en.opensuse.org/S2ram for details.

    If you report a problem, please include the complete output above.
    method return sender=:1.0 -> dest=:1.66
    boolean true
    method return sender=:1.0 -> dest=:1.67
    boolean true
    method return sender=:1.0 -> dest=:1.68
    boolean true
    method return sender=:1.0 -> dest=:1.69
    boolean false
    method return sender=:1.0 -> dest=:1.70
    boolean false
    method return sender=:1.0 -> dest=:1.71
    boolean false
    method return sender=:1.0 -> dest=:1.72
    boolean false

    what did i do wrong? :( hope you could help me with this.

  21. Paul Betts said,

    April 21, 2007 @ 8:38 pm

    s2ram uses a whitelist of supported boards - for some reason, your computer isn’t reporting the vendor information right. You might want to use the regular kernel suspend-to-ram if you can by editing the HAL scripts to run /usr/sbin/pmi-disabled.

  22. Chris Ian Fiel said,

    April 21, 2007 @ 9:18 pm

    I have tried the -f, --force: force suspending, even on unknown machines. and it works like a charm! thanks again paul. :)

  23. Kevin. said,

    April 23, 2007 @ 7:38 pm

    Thanks for the post. Now I can suspend and resume perfectly, except for one thing. I’m running Beryl, and the desktop cube no longer works. I can’t rotate the cube or otherwise switch workspaces. Everything else, including other desktop effects, seems to work just fine. Ideas?

  24. Kevin. said,

    April 23, 2007 @ 7:43 pm

    Never mind, I had the plugin disabled.

  25. Mattias said,

    April 24, 2007 @ 9:06 am

    Sweet, this guide helped me a lot! Now I will put in another memory module and see if it can handle that too (which it could not do before).

    Cheers!

  26. RIk said,

    April 25, 2007 @ 10:26 am

    thanks a lot for this
    POWER of Linux POWAAAA

  27. scotty said,

    April 26, 2007 @ 8:59 am

    This fixed worked great on a Thinkpad T40. Thanks!

  28. Robert Persson said,

    April 27, 2007 @ 5:33 pm

    I just tried uswsusp and it modified the initrd so that the system was unbootable. I had to boot from a CD in order to get back to booting from a working initrd.

  29. Paul Betts said,

    April 27, 2007 @ 6:22 pm

    uswsusp doesn’t modify the initrd afaik, perhaps your resume partition was set to /boot instead?

    // got nothin’

  30. Java Thinking » Moving to Ubuntu said,

    April 28, 2007 @ 3:19 am

    […] and from work. I’ve just now fixed hibernation by following Robin Battey’s comment on this blog (it’s the 4th comment). However, after resuming my usb mouse doesn’t work (this is […]

  31. Tobias said,

    April 28, 2007 @ 4:06 pm

    Thank you, this worked very well until a recent rather inconspicuous Feisty update it seems. Is there a change in the procedure? I have both the scripts in /usr/lib/hal/scripts/linux/ and pmi package diverted. But now, when I try to hibernate from the shutdown dialog, it’s definitely not invoking s2disk. It locks the screen into the screensaver, and the keyboard stops responding. That’s the same behavior I had before installing uswsusp.

  32. Hiredgoon said,

    April 29, 2007 @ 10:01 am

    This worked for me with a few more tweaks.

    I tried the original solution and it didn’t work. So I replaced the scripts with the originals and started over trying Robin Battey’s solution. It worked from the command line but stopped working once I implemented the dpkg diversion and installed the splash screens. (I would get an error popup from the HAL in my System Notification Area telling me Hibernate failed for some reason.)

    Getting frustrated (because this worked fine in Edgy), I started tinkering and found Robin’s solution works for me flawlessly as long as I don’t use the splash screens.

    I am using the NVidia Legacy drivers which come with Feisty (7184) and they don’t support Suspend so I have not tried that yet. :)

    One other thing, on Edgy I had to edit my xorg.conf and add the line:

    Option “NvAGP” “1″

    …to my device section before Hibernate would work. I had to make the same edit in Feisty before the native hibernate function would work at all - and then it would only let me hibernate once before crapping out - which is how I ended up here in the first place.

    Now I am totally happy again! Thanks all!

    -hg

  33. Jagadish said,

    April 29, 2007 @ 3:24 pm

    Though I am not trying to suspend or hibernate, I still get these in my boot messages when I boot Kubuntu Feisty normally:

    [ 5.752000] Attempting manual resume
    [ 5.752000] swsusp: Resume From Partition 8:6
    [ 5.752000] PM: Checking swsusp image.
    [ 5.752000] PM: Resume from disk failed.

    The boot happens successfully though, except for a small delay caused by the attempt to ‘resume’.

    Any suggestions on how to get rid of the ‘Resume’ and have a normal boot? Thanks in advance.

  34. Paul Betts said,

    April 29, 2007 @ 4:08 pm

    @Jagadish: This just means that it looked for a resume image before booting, it’s normal

  35. Jagadish said,

    April 30, 2007 @ 12:14 am

    Paul,
    Thanks for that information. Glad to know the behavior is normal.

  36. Jagadish said,

    May 1, 2007 @ 1:31 am

    A boot option of ‘noresume’ in /boot/grub/menu.lst got rid of the message and the attempt to resume.

  37. Paul Betts said,

    May 1, 2007 @ 4:20 pm

    Yeah, but now when you do decide to hibernate, instead you’ll corrupt all your mounted filesystems

  38. casey said,

    May 1, 2007 @ 9:16 pm

    Hey! I have an HP Pavilion dv6000 running Feisty, which was fairly challenging to set up. At some point in trying to resolve ACPI and Broadcom issues, my hibernate stopped working.

    Your scripts got it working again! Suspend is still broken (probably an NVidia issue), but hibernate is a *lot* better than complete shutdown/startups.

  39. Jagadish said,

    May 2, 2007 @ 1:53 am

    Paul,
    I live in a place where power outages are common. I really can’t use suspend or hibernate therefore. But now that you have told me, I have to be careful that I don’t accidentally invoke hibernate. I have commented out the line

    ACPI_HIBERNATE=true

    in /etc/default/acpi-support. That should do to disable hibernate, is that correct?
    This link,
    http://jeremy.sunriseroad.net/2007/02/how-to-disable-suspend-and-hibernate-for-all-users-in-ubuntu/,
    told me how to get rid of the suspend and hibernate buttons in gnome.

    Don’t know how to do that in KDE’s Power Manager, though.

  40. Cooper said,

    May 3, 2007 @ 9:05 pm

    I get the message “suspend: Could not stat the resume device file” when attempting to run s2disk. Any suggestions?

  41. Argh said,

    May 7, 2007 @ 5:11 am

    Here’s what happened after the test:

    First boot:
    Grub won’t load, turn off manually

    Second Boot:
    Message saying cant find image file in /idont/remember/the/path
    and i can’t start X

    Third Boot
    Uff finally i’m in…

    Any tips or suggestions apart from: >

  42. Abilitare suspend e hibernate Feisty « Divilinux Lost Blog said,

    May 7, 2007 @ 3:45 pm

    […] Per sapere di piu’ sugli script e il loro funzionamento:Fonte Paulbetts […]

  43. Fix sospensione « GrayMalkin ^^ said,

    May 8, 2007 @ 1:50 pm

    […] Per sapere di piu’ sugli script e il loro funzionamento:Fonte Paulbetts […]

  44. st0rk said,

    May 9, 2007 @ 10:54 am

    after s2disk the resolution reset to 1024×768 - is not correct! i want 1280×800!!!
    as i know i915 module is not load! after reboot - all ok!
    how to fix this?

  45. Krampusz said,

    May 10, 2007 @ 12:35 pm

    I have the same problem as st0rk said:
    after resume the resolution reverts to a lower one.
    Any ideas? It is probably an i915 issue…

    thanks,
    -Krampusz

  46. Paul Betts said,

    May 10, 2007 @ 7:31 pm

    Well, this doesn’t happen to me; are you able to set the resolution using the “Screen Resolution” applet or is it stuck? It might be an i915 bug - check to see if the module is loaded, and read your dmesg output.

    You *could* be able to hack it by adding a command to set the screen resolution to the resume script, or just put a script on your desktop called “Fix the Screen” or some such, but make sure to file a bug with Ubuntu Launchpad (really easy in Feisty) so that the devs at least know about it.

  47. zero1 said,

    May 12, 2007 @ 9:48 am

    anyone got to work uswsusp on Feisty? it freezes on resume. hibernate is fine. plus it seems to break the splash on regular startup…but on shutdown it’s ok…. i think…

  48. st0rk said,

    May 12, 2007 @ 3:31 pm

    i using Feisty - module is load but 915resolution show allow mode - 1280*800 is not in list, after reboot - resolution set to 1280*800 and 915resolution show this mode in list! may be uswsusp is old in my system - i am download and install not a newest version but not very old - for feisty - in repository

  49. hihihi said,

    May 13, 2007 @ 11:03 am

    hello, thanks,
    this helped. now i can hybernate.
    i followed Robin Battey’s tips for renaming pmi.
    since than it works fine, thanks to you all.
    hihihi

  50. hihihi said,

    May 13, 2007 @ 11:11 am

    update:

    hybernation works, never worked before,
    BUT
    sleep does not work anymore, it falls back into login screen.
    runnuing ubuntu feisty, nvidia 6600go.
    any ideas?
    bye

  51. hihihi said,

    May 13, 2007 @ 12:16 pm

    update2:

    sleep works now. because this laptop is not in whitelist i have to force s2ram:

    sudo s2ram -f

    for those who want to know how to make this permanent to apply force s2ram to sleep-button or power-manager, this is what i did:

    $ sudo gedit /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux
    than i went to the line where this is writen:
    elif [ -x “/sbin/s2ram” ] ; then
    /sbin/s2ram
    and changed to:
    elif [ -x “/sbin/s2ram” ] ; then
    /sbin/s2ram -f

    thats it.
    probably i’ll have to do that again when hal is updated, but ok.

  52. zero1 said,

    May 14, 2007 @ 12:11 am

    yeah, hibernate works fine for uswsusp. how about resume guys? does it work for you?

  53. Morgan said,

    May 15, 2007 @ 9:08 am

    Robert Persson: I got the same thing, it looked like it changed something in the kernel and in grub. But I was able to boot up with an old kernel and remove the package… Back to drawing board.

  54. OlivierSeres said,

    May 16, 2007 @ 4:52 pm

    My Thinkpad T41 mustn’t be in the white list because the screen is black after suspension+awake. Forcing s2ram works better but i don’t see the ubuntu icons anymore…

  55. aZeem said,

    May 17, 2007 @ 3:17 pm

    USB is still not working after awake on my Compaq nc4010 :-(

  56. Sat said,

    May 17, 2007 @ 10:23 pm

    I installed uswsusp using Robin’s trick (using divert) and everything was working fine. However, a new hal package came out a couple days ago and now that I updated, “Quit… Hibernate” no longer hibernates. The screen goes blank for a few seconds then it has the same password prompt as when you switch users. However, “sudo s2disk” still works. Any ideas what happened?

  57. Diaa said,

    May 19, 2007 @ 1:38 pm

    I installed hibernate, configured it as mentioned here https://www.klabs.be/~fpiat/linux/debian/Etch_on_Thinkpad_T60.html#Hibernation and I got 915resolution working properly after hibernation, so I get 1280×800 without problems after resuming.

  58. _deneb_ said,

    May 22, 2007 @ 3:08 am

    I am having terrible troubles with SUSPEND, while HIBERNATE works fine.

    Let’s me explain my problem, hoping you can help me :

    Once I installed my Feisty and tried to SUSPEND the system I couldn’t wake him up in any way! Even pressing the power button for minutes wouldn’t even shut down the system… I had to remove the CELL every time (XoX).

    Now I tried with the tricks you suggested but when I try to suspend, I get a black screen, then a login windows and when I log a message telling me that the system wasn’t able to SUSPENDED

    How can I get rid of the problem? It’s really annoying..
    I have a Toshiba Satellite M40-284 with an ATI Xpress 200M whose driver is in the RESTRICTED DRIVERS LIST and now DISABLED ( in the same list Atheros HAL is ENABLED)

    Any clues pals??
    _deneb_

  59. bed said,

    May 27, 2007 @ 7:14 am

    Lucky me! Thanks to you, my Asus G1 is now fully working with suspend to disk!
    ‘You can read about it in my Blog https://zockertown.de/s9y/archives/840-Asus-G1-software-suspend-unter-LinuxMint.html
    Worthful to meantion, that this works under Linuxmint, a derivate beside Ubunty Feisty.

  60. James said,

    May 28, 2007 @ 8:22 am

    Ack! I tried your test and now my Feisty will not resume, or reboot!

    It gets as far displaying the Ubuntu logo / bar graph and then goes to a blank screen with a single cursor blinking (no prompt). Keyboard is unresponsive.

    I’ve tried to get into the system to see what’s up using the Ubuntu CD to go into rescue mode, but I don’t really know what I am trying to fix!

    Any suggestions? My heads’ sore from beating it against the monitor….

  61. Andrew Waldram said,

    May 29, 2007 @ 7:08 am

    Try pressing Ctrl alt F1 then read the error message

    press enter to continue boot.

    Suspect your issue is the new kernel 2.6.20-16 not related to suspend at all.

  62. Mr Ming said,

    June 4, 2007 @ 4:29 am

    The same happened to me as James above. The worst thing is that after removing uswsusp via apt-get remove I’m now unable to start KDE or Gnome and just keep getting bounced back to the login prompt. Has anyone got any suggestions as to how I can get my GUI back?

  63. Paul Betts said,

    June 4, 2007 @ 10:19 am

    @Mr. Ming: I think your X problem is unrelated to uswsusp, try following the steps in my un-break X entry:

    http://blog.paulbetts.org/index.php/2007/06/01/the-cleanest-easiest-way-to-fix-xorg-related-problems-in-ubuntu/

  64. Sat said,

    June 5, 2007 @ 1:14 am

    I think i had a problem similar to what people were experiencing with ubuntu not loading after hibernate. This happened after ubuntu updated to the latest kernel. If you try to hibernate before you restart, when you come back from hibernation it will boot into the latest version of the kernel and just freeze there on the black screen. Just reboot and select the latest version of the kernel and everything should be okay. Make sure you reboot after updating your kernel before trying to hibernate.

  65. Sat said,

    June 5, 2007 @ 1:16 am

    Sorry, that should have read “Just reboot and select the previous version of the kernel…” :)

  66. Scott said,

    June 5, 2007 @ 6:29 pm

    I’m having a problem with hibernate and my broadband modem. I’m running Feisty and have a Verizon 5740 broadband modem installed. When the computer resumes, I try to restart the modem with wvdial, but I get

    --> Cannot open /dev/ttyACM0: No such file or directory.

    I then have to reboot to get the modem to work again. Anyone have a fix for this?

  67. oliverr said,

    June 9, 2007 @ 12:41 pm

    I have foun a very easy solution to make hibernate working for all notebooks for Ubuntu Feisty with default hibernate software.

    cd /etc/acpi
    vi wireless.sh
    change the line
    toggleWirelessStates;
    to this
    toggleAllWirelessStates;

    It works 100%, i think some developer made a typo error in the file, because the function toggleWirelessStates does not exist, instead there exist the function toggleAllWirelessStates.

  68. Goli said,

    June 10, 2007 @ 4:41 pm

    Hi,

    I am very very new to ubuntu and I also have a problem hibernating. I attempted to resolve this problem but I obviously do not know what I am doing. When I downloaded hal-system-power-hibernate-linux* and hal-system-power-suspend-linux, I manually replaced the orignal scripts with the downloaded scripts in the HAL directory without backing up the originals. (I did not know what to do with the downloaded files) Now I do not know how to get the original scripts back. Can anyone help me? I am assuming that the original scripts are different from the ones I downloaded, and I would very much like to fix what I did. I am running feisty fawn. Please, if anybody can offer some advice, I would really appreciate it.

  69. vanadium said,

    June 13, 2007 @ 10:03 am

    The two commands

    sudo apt-get install uswsusp
    sudo dpkg-divert --rename --divert /usr/sbin/pmi-disabled /usr/sbin/pmi

    worked for me for Ubuntu Feisty on a Dell Latitude D800

    This blog was referred to here in the ubuntu forum http://ubuntuforums.org/showthread.php?p=2836342#post2835450

    Thank you very much!

  70. scoutme said,

    June 13, 2007 @ 11:02 am

    I had problems with hibernation, installed the new scripts, and things got worse. My question is: since I’m a dumb and I didn’t backup any file before copying the scripts, what should I do to restore original scripts?

  71. Marius Magda said,

    June 13, 2007 @ 1:22 pm

    Hi!
    My Ubuntu Feisty would not resume from hibernate with “uswsusp”. So I added in the “Device” section (/etc/X11/xorg.conf) the following line:

    Option “NvAGP” “1″

    Then I included in /etc/modprobe.d/blacklist the following line:

    blacklist intel_agp.

    It worked! I’ve learned that in openSUSE 10.2. You can guess I have a nvidia graphic card (440MX).

  72. Fixing software suspend / hibernate with uswsusp in Ubuntu Feisty (and Edgy) said,

    June 19, 2007 @ 5:05 pm

    […] Article comes from: http://blog.paulbetts.org/index.php/2007/02/11/fixing-software-suspend-hibernate-with-uswsusp-in-ubu… […]

  73. pearsonbe said,

    June 22, 2007 @ 7:37 pm

    So far, oliverr’s comment (#67) worked for me. After upgrading to the latest kernel and trying to hibernate, my computer sometimes would not boot and would shut down automatically. After modifying the wireless.sh file (tonight), I have not had boot issues. However, I have not tried to hibernate - I’ll give it a couple of days.

    Greg

  74. gagarine said,

    June 29, 2007 @ 3:56 am

    Thanks, work juste fine on my Thinkpad t60p.

  75. Django said,

    July 6, 2007 @ 3:57 am

    Using uswsusp with the trick above (thank you!) and kernel-2.6.17-11-generic (from the earlier edgy install?) worked for me on a Thinkpad T23: USB and mounted devices “survive” suspend/resume.

  76. Kai said,

    July 13, 2007 @ 5:54 am

    `aptitude install uswsusp` did it for me on my Thinkpad R50e (feisty)! no need to copy over the hal-files!

  77. Tien said,

    July 13, 2007 @ 8:04 pm

    Hi,
    I have a T41p, while trying the “suspend’ button, my laptop now can not be power up again. Anyone know a good fix for this (hidden reset button somewhere?
    I was using Ubuntu 6.1
    Thanks,

  78. Problem z usypianiem / hibernacją w Ubuntu Feisty Fawn (Dell Inspiron E1505/6400). said,

    July 14, 2007 @ 2:01 pm

    […] Źródło: http://blog.paulbetts.org […]

  79. William M said,

    July 26, 2007 @ 7:28 am

    I had mixed success using this technique on my Thinkpad T23 with kernel 2.6.20-16-386. The first time, after having resumed from a swsusp suspend, the system froze. On tty1 (Alt+F1), there was output indicating that it could not read the stored data. I rebooted the system and tried again. This time it resumed perfectly.

  80. Pascal said,

    August 3, 2007 @ 4:10 am

    Works fine on HP nc2400 (Feisty, kernel 2.6.20-16). Thanks a lot.

  81. omjoi said,

    August 5, 2007 @ 4:39 am

    I still have problems suspending/hibernating on a T23 running Feisty Fawn (2.6.20-16-generic): it suspends/hibernate but after resuming sound and USB don’t work, I have to reboot to have them working again.
    Any suggestion is more than welcome, thanks in advance.

  82. hitch said,

    August 16, 2007 @ 4:01 am

    I have an Asus G1 with 2GB of Ram. Unfortunately I set my swap up wrong when I partitioned the machine, and i have two separate swap partitions, which add up to a total > 2GB, but each of them is less than 2GB. I understand that swap must be larger than ram for suspend to work. Is this total swap that must be greater, or a single swap partitions - i.e. does suspend treat swap as a whole unit, or only use a single swap partition?

  83. kallistra said,

    August 17, 2007 @ 10:16 pm

    I’ve a Dell Inspirion E1705 with Feisty installed and was having a time with hibernate and suspend. I have mine working perfectly now.

    I followed the info @ https://www.klabs.be/~fpiat/linux/debian/Etch_on_Thinkpad_T60.html#Hibernation from Diaa above. Installed both tools - hibernation and uswsusp, modified my confs.

    Since I’ve had no problems with suspend, only hibernate, I did the following modifications to my hal-system-power-hibernate-linux. However, never know when I’ll have to mod these again. I’d recommend just moving the groups around and not actually deleting anything in your script, but as long as you save the old one doesn’t matter.

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

    =======================
    Find the following
    =======================

    if [ -x “/usr/bin/powersave” ] ; then
    $POWERSAVED_SUSPEND2DISK
    RET=$?

    ======================
    Change to…
    ======================
    if [ -x “/usr/sbin/hibernate” ] ; then
    # Suspend2 tools installed
    /usr/sbin/hibernate --force
    RET=$?

  84. William said,

    August 17, 2007 @ 11:22 pm

    Wow, this is the perfect solution to my Dell Inspiron 1501 hibernation problems! Thanks for the tip!

  85. William said,

    August 17, 2007 @ 11:27 pm

    Almost perfect. The sound doesn’t come back :(

  86. omjoi said,

    August 19, 2007 @ 5:52 am

    I have alsa-utils installed for the soundcard. After suspend/hibernation it is enough to type:

    sudo /etc/init.d/alsa-utils restart

    to have the sound back.
    Is there a way to add this command to a sort of “restore from suspend/hibernation” script?

    Still no joy with the USB.

  87. Paul Betts said,

    August 19, 2007 @ 8:23 pm

    @omjoi: Yeah, look in /etc/acpi/resume.d; as to the USB, you might have to remove and readd the USB modules (uhci_hcd, ehci_hcd).

  88. quin said,

    August 25, 2007 @ 6:06 pm

    That has fixed a long-standing susp/hib problem of mine thanks. HOWEVER, if anybody has advice on how NOT to have (k)ubuntu make crackling sounds and distorted screens on coming out of suspension/hibernation I’d be enormously grateful. I have an HP nx8220, but seem to remember the same issue with a DELL I have. It looks aweful and very unprofessional. I won’t be taking my HP into a boardroom any time soon until it boots up ‘pretty’

  89. Maverick said,

    August 29, 2007 @ 4:22 am

    Guys,

    i installed uswsusp and my ubuntu failed to boot. All i did was change the initrd.img---- to initrd.img----.bak. Looks like uswsusp backedup my initrd file before screwing up the ubunutu installation.

  90. Ric said,

    September 1, 2007 @ 11:43 pm

    Thanks Paul. This worked for me however there are times wherein my screen is all white after resuming from suspend/hibernate. Pressing Ctrl + Alt + Backspace fixes it and returns me to the GDM login screen ( thus making my suspend attempt pointless as my previous session becomes totally lost ). Got any ideas? Im on a Dell Latitude D620, Nvidia Quadro NVS 110m, Feisty, Compiz Fusion.

    Thanks again for the wonderful guide.

  91. Paul Betts said,

    September 2, 2007 @ 12:20 am

    @Ric: Try hitting Ctrl-Alt-F2, then Ctrl-Alt-F7 to force X to reinitialize itself - it’s a hack but it might work. You could also try upgrading your nVidia driver and your copy of Compiz Fusion (sorry for the shotgun debugging, the white screen can be caused by a whole bunch of things)

  92. sberla said,

    September 6, 2007 @ 4:15 pm

    I have a little problem:
    Whit your scripts i can hibernate (a lots of thanks before not)
    But after restore when i call from shell
    sudo s2disk (after a previous hibernation) it look only the screen?
    What i can do?

  93. Vadim P. said,

    September 13, 2007 @ 6:52 am

    Hi,

    I tried ’sudo apt-get install uswsusp \n sudo s2disk’, and it worked perfectly for me the first time.

    However, when after that I did ’sudo dpkg-divert --rename --divert /usr/sbin/pmi-disabled /usr/sbin/pmi’, and added a slplashy. Now it goes into hibernation properly, but fails to come out of it - just get’s stuck on the slpash screen, and no ctrl+alt+f2, ctrl+alt+f7, ctr+alt+backspace help. I have to reboot the laptop, and it loads not from the hibernation but fine.

    Any ideas on what can be wrong? I’m on a ThinkPad T40 here (hibernation was actually working fine before, if you exclude the weird graphical glitch that would appear on the screen. But suspend wasn’t).

  94. Dan said,

    September 19, 2007 @ 5:37 am

    I have an Asus M2400N Laptop which only starts with the lapic kernel option. When I invoke s2ram from the shell everything is working fine. But the gnome panel still uses its own suspend procedure. I have diverted the pmi command and even replaced the scripts in /usr/lib/hal/scripts/linux but Gnome doesn’t seem to care.
    Since this is my girlfriends laptop I would like to keep it as easy as possible. Has anyone an idea how to fix this?

  95. sindhu said,

    September 21, 2007 @ 8:26 am

    hi! i was wondering if you could tell me how to wake up ubuntu from hibernate automatically?

    on xp, i do this with “WOSB”.

  96. hela said,

    September 29, 2007 @ 8:56 pm

    uswsusp works pretty well on my thinkpad r60e, feisty.
    think you.

  97. Zechs の BLOG » Ubuntu Diary : Suspend and Hibernate with µswsusp said,

    October 2, 2007 @ 7:25 pm

    […] http://blog.paulbetts.org/index.php/2007/02/11/fixing-software-suspend-hibernate-with-uswsusp-in-ubu… […]

  98. after a recent xoops update my second hard drive failed to mount reading bug tracker I found a Fix gnome-mount –device by New Zealand Web Hosting Provider said,

    October 4, 2007 @ 5:39 am

    […] http://blog.paulbetts.org/index.php/2007/02/11/fixing-software-suspend-hibernate-with-uswsusp-in-ubu… suggests to Download these two files: […]

  99. Michele said,

    October 7, 2007 @ 7:24 am

    Hello Paul,

    Compaq Evo N610c running Feisty.

    Hibernates and resumes ok, but the USB ports (including the Wireless Lan module) stop working.

    On the 19th of August you wrote:
    [quote]…as to the USB, you might have to remove and readd the USB modules (uhci_hcd, ehci_hcd).[/quote]

    As I am fairly new to Linux, could you please elaborate?

    Cheers,

    Michele

  100. Paul Betts said,

    October 8, 2007 @ 12:34 am

    @Michele:

    sudo rmmod uhci_hcd ehci_hcd && sudo modprobe uhci_hcd ehci_hcd

    should do the trick. Basically, you’re unloading the driver and reloading it again; it’s a hack and you should think about putting a bug in Launchpad about it (make sure to see if someone already filed it first!)

  101. Michele said,

    October 8, 2007 @ 3:53 am

    Hello Paul,

    Just for the benefit of other people who could be in my situation, I managed to reactivate my USB issuing the second part of your command i.e.

    sudo modprobe ehci_hcd

    My box complained that there was no mod to remove and gave me an error when I tried to modprobe uhci_hcd.

    Cheers,

    Michele

  102. Benoit Labourdette said,

    October 13, 2007 @ 2:41 am

    Hi, after downloading the two files:
    * hal-system-power-hibernate-linux
    * hal-system-power-suspend-linux
    they are on the desktop. And what to do with them before typing the commands? We have to copy them somewhere?

  103. pyro said,

    October 14, 2007 @ 5:15 pm

    Hello,

    I first would like to thank you for this tip, it worked very well on my Acer since I found this page (5 days ago…).

    But …

    Yesterday my laptop crashed when going back from suspend… (don’t exactly know why… black screen and nothing was possible. So I hardly rebooted it by pushing power button…
    It restarted but there is a lot of problems since : no more wireless network possible (like if my wifi card was suddenly not functionning), my battery level indicator is staying at “low” and no more info is available, buttons like wifi and bluetooth activation are not activable anymore…

    Arrghhhhh …. I was so happy to be able to suspend but now … shit !

    I think that some data was in RAM and has disappeared in the crash but I dont really know what to do now ? Reinstall eveything ? (already tryed no reinstall network manager… reboot, restart services…)

    Thanks a lot in advance if someone can help… (and sorry for my bad english…)

  104. Paul Betts said,

    October 14, 2007 @ 7:53 pm

    @pyro: It could be that you’ve corrupted some system files. Try booting in recovery mode and running fsck

  105. pyro said,

    October 15, 2007 @ 7:55 pm

    Thank you very much for your help !

    I hadn’t tested recovery mode before, I did it, and everything seemed to be alright under it ! happy ! my wifi led appears again ,-)

    I did an fsck and went back in “normal” mode, magical !

    I have my leds, wifi connection, battery… everything is working again !
    so happy with that (and I learned a new command ;-)

    If there was a grade it would have been a ten out of ten.

  106. eli said,

    October 31, 2007 @ 10:21 am

    This worked great for my Averatec 1020 notebook on Gutsy. In Feisty I was able to get suspend and hibernate working without uswsusp, but upgrading to Gutsy broke it. So, uswsusp to the rescue.

  107. cheezo said,

    November 13, 2007 @ 10:56 pm

    this works for my T60p on Gutsy.
    Many thanks for this solution.

  108. Articles said,

    November 21, 2007 @ 6:54 am

    I’m using Edgy and get the following error message when the second line of Robin Battery’s (March 16th) two lines commands are run

    dpkg-divert: --add needs a single argument

    Any thoughts?

  109. Max said,

    January 6, 2008 @ 5:51 am

    Found out the best way of fixing the issue is installing pm-utils… apparently no script necessary…

    https://bugs.launchpad.net/ubuntu/+source/uswsusp/+bug/134238/comments/16

  110. Max said,

    January 6, 2008 @ 6:36 am

    Correction, the scripts are still needed (with pm-hibernate and pm-suspend instead of s2disk and s2ram)

    The trick will do for gutsy, which removed s2ram from uswusp.

    Does someone know how to add a command to the resume sequence (i tried to a script in acpi/resume.d, without success)

    then command would be
    [code] hdparm -B 254 /dev/hda [/code]

    Thanks

  111. GOwin said,

    January 23, 2008 @ 6:56 am

    the s2disk works fine when ran from the command line. However, if it’s used thru g-p-m, it takes ‘forever’ and never shuts down.

    Any ideas how to resolve this?

  112. Mackenzie Cyr said,

    February 18, 2008 @ 7:47 am

    Edward P. Tryon - In answer to the question of why it happened, I offer the modest proposal that our Universe is simply one of those things which happen from time to time.

  113. Demenzia.net – Using suspend to disk with eeeXubuntu on a eeePC said,

    February 21, 2008 @ 7:22 pm

    […] Fixing software suspend / hibernate with uswsusp in Ubuntu Feisty (and Edgy) […]

  114. ano said,

    February 22, 2008 @ 6:28 am

    THanks!
    THis works on my Ubuntu 7.10; AMD 62 x2 4000+. Nvidia 6100

  115. Johannes Midgren said,

    March 17, 2008 @ 5:42 pm

    Thanks a lot, Max!

    For all of you running Gutsy: make sure to install “pm_utils”!

    s2disk and s2both from “uswsusp” worked fine for me, but since at least s2both is not included in the hal-scripts you will have to edit these (hal-system-power-suspend/hibernate-linux) to make it work with gnome.

    Using pm-hibernate/pm-suspend from “pm_utils” works out of the box for me on an HP Compaq nc8230, both from bash and in gnome.

  116. Linux Erfahrungsbericht « Tom’s Webbox said,

    March 25, 2008 @ 7:26 pm

    […] Grafiktreibers beim wiedereinschalten nur einen Schwarzen Bildschirm zeigte bin ich auf folgenden Tip gestoßen: Man nutzt statt des integrierten Modus das Programm uswsusp. Bevor man dieses aber fest […]

  117. Bob/Paul said,

    April 28, 2008 @ 11:19 am

    I just got this working again on Hardy. The dpkg-diversion can be removed for /usr/sbin/pmi as the suspend/hibernate scripts now check for the existance of uswsusp before trying other methods.

    Unfortunately, an old bug remains (#207002, though I swear I reported it last fall already…) in which the pmi scripts expect to find s2disk in /usr/sbin/ but the package installs itself to /sbin/

    dpkg-divert to the rescue again. One can do “dpkg-divert --divert /usr/sbin/s2disk --rename /sbin/s2disk”. Once the bug is resolved and the pm-utils package is fixed, one can do “dpkg-divert --rename --remove /sbin/s2disk” (note that if you forget, you can do “dpkg-divert --list” to show the diversions you’ve set up…)

  118. sohbet said,

    April 30, 2008 @ 6:12 am

    Found out the best way of fixing the issue is installing pm-utils… apparently no script necessary…

  119. How To Install Ubuntu 8.04 Hardy Heron On The Asus M50Sv-A1 « See This, Now Read This said,

    May 19, 2008 @ 6:17 pm

    […] this is a core feature of any notebook and that is why I am including this fix in my guide. One blog by Paul Betts provided me with a generic tutorial written around uswsusp that only partially worked […]

  120. jrobbo said,

    May 31, 2008 @ 11:17 pm

    Hi, just wanted to say thanks for sharing this info, it’s great to finally have Hibernate working the way that it should! Cheers, John

  121. arcx said,

    June 6, 2008 @ 5:27 pm

    This seems to work for me on on kubuntu Hardy Heron 8.04
    sudo ln -s /sbin/s2disk /usr/sbin/s2disk
    Though maybe it would cause problems if the package actually moved to /usr/sbin/s2disk - don’t know

  122. nomasteryoda said,

    August 17, 2008 @ 10:39 pm

    Excellent help guys. I now have my Nvidia based Dell Inspiron 8600 working with suspend to ram using the uswsusp solution and Mr. Battey’s solution are super sweet!!

    Wonder how this could be added to the Restricted drivers manager to setup auto magically when Nvidia driver gets installed?

    later…
    nomasteryoda, sleeping

RSS feed for comments on this post · TrackBack URI

Leave a Comment