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:
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:
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.
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.
Ralph
13 Feb 07 at 5:31 pm
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.
Tobi
3 Mar 07 at 9:38 am
[...] 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) [...]
its about time» Blog Archive » links for 2007-03-05
5 Mar 07 at 6:34 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
Robin Battey
16 Mar 07 at 9:27 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?
snowpunk98
20 Mar 07 at 1:03 pm
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
pjotre
30 Mar 07 at 7:10 am
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?”)
Paul Betts
30 Mar 07 at 2:00 pm
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.
pjotre
1 Apr 07 at 2:16 am
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.
moses
12 Apr 07 at 5:25 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?
ltmon
12 Apr 07 at 8:45 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
Paul Betts
12 Apr 07 at 8:50 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.
ltmon
13 Apr 07 at 10:05 pm
thank you
http://ubuntuforums.org/showthread.php?p=2461650#post2461650
jay
16 Apr 07 at 6:40 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?
calvin
20 Apr 07 at 12:12 pm
> dpkg-divert: –add needs a single argument
>
> Any thoughts?
sudo dpkg-divert –add –rename –divert /usr/sbin/pmi-disabled /usr/sbin/pmi
Niels
21 Apr 07 at 6:53 am
Where did you guys get the ‘–add’ from, it only says ‘–rename –divert’?
Paul Betts
21 Apr 07 at 9:48 am
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.
Chris Ian Fiel
21 Apr 07 at 12:29 pm
Retype it, making sure that the dashes come out as the right character – Wordpress replaces ‘dash dash’ with a funny long dash. Annoying.
Paul Betts
21 Apr 07 at 12:33 pm
Thanks paul its works flawlessly. linux rocks!
Chris Ian Fiel
21 Apr 07 at 7:27 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.
Chris Ian Fiel
21 Apr 07 at 7:59 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.
Paul Betts
21 Apr 07 at 8:38 pm
I have tried the -f, –force: force suspending, even on unknown machines. and it works like a charm! thanks again paul.
Chris Ian Fiel
21 Apr 07 at 9:18 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?
Kevin.
23 Apr 07 at 7:38 pm
Never mind, I had the plugin disabled.
Kevin.
23 Apr 07 at 7:43 pm
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!
Mattias
24 Apr 07 at 9:06 am
thanks a lot for this
POWER of Linux POWAAAA
RIk
25 Apr 07 at 10:26 am
This fixed worked great on a Thinkpad T40. Thanks!
scotty
26 Apr 07 at 8:59 am
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.
Robert Persson
27 Apr 07 at 5:33 pm
uswsusp doesn’t modify the initrd afaik, perhaps your resume partition was set to /boot instead?
// got nothin’
Paul Betts
27 Apr 07 at 6:22 pm
[...] 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 [...]
Java Thinking » Moving to Ubuntu
28 Apr 07 at 3:19 am
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.
Tobias
28 Apr 07 at 4:06 pm
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
Hiredgoon
29 Apr 07 at 10:01 am
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.
Jagadish
29 Apr 07 at 3:24 pm
@Jagadish: This just means that it looked for a resume image before booting, it’s normal
Paul Betts
29 Apr 07 at 4:08 pm
Paul,
Thanks for that information. Glad to know the behavior is normal.
Jagadish
30 Apr 07 at 12:14 am
A boot option of ‘noresume’ in /boot/grub/menu.lst got rid of the message and the attempt to resume.
Jagadish
1 May 07 at 1:31 am
Yeah, but now when you do decide to hibernate, instead you’ll corrupt all your mounted filesystems
Paul Betts
1 May 07 at 4:20 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.
casey
1 May 07 at 9:16 pm
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.
Jagadish
2 May 07 at 1:53 am
I get the message “suspend: Could not stat the resume device file” when attempting to run s2disk. Any suggestions?
Cooper
3 May 07 at 9:05 pm
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: >
Argh
7 May 07 at 5:11 am
[...] Per sapere di piu’ sugli script e il loro funzionamento:Fonte Paulbetts [...]
Abilitare suspend e hibernate Feisty « Divilinux Lost Blog
7 May 07 at 3:45 pm
[...] Per sapere di piu’ sugli script e il loro funzionamento:Fonte Paulbetts [...]
Fix sospensione « GrayMalkin ^^
8 May 07 at 1:50 pm
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?
st0rk
9 May 07 at 10:54 am
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
Krampusz
10 May 07 at 12:35 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.
Paul Betts
10 May 07 at 7:31 pm
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…
zero1
12 May 07 at 9:48 am
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
st0rk
12 May 07 at 3:31 pm
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
hihihi
13 May 07 at 11:03 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
hihihi
13 May 07 at 11:11 am
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.
hihihi
13 May 07 at 12:16 pm
yeah, hibernate works fine for uswsusp. how about resume guys? does it work for you?
zero1
14 May 07 at 12:11 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.
Morgan
15 May 07 at 9:08 am
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…
OlivierSeres
16 May 07 at 4:52 pm
USB is still not working after awake on my Compaq nc4010
aZeem
17 May 07 at 3:17 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?
Sat
17 May 07 at 10:23 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.
Diaa
19 May 07 at 1:38 pm
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_
_deneb_
22 May 07 at 3:08 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.
bed
27 May 07 at 7:14 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….
James
28 May 07 at 8:22 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.
Andrew Waldram
29 May 07 at 7:08 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?
Mr Ming
4 Jun 07 at 4:29 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/
Paul Betts
4 Jun 07 at 10:19 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.
Sat
5 Jun 07 at 1:14 am
Sorry, that should have read “Just reboot and select the previous version of the kernel…”
Sat
5 Jun 07 at 1:16 am
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?
Scott
5 Jun 07 at 6:29 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.
oliverr
9 Jun 07 at 12: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.
Goli
10 Jun 07 at 4:41 pm
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!
vanadium
13 Jun 07 at 10:03 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?
scoutme
13 Jun 07 at 11:02 am
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).
Marius Magda
13 Jun 07 at 1:22 pm
[...] Article comes from: http://blog.paulbetts.org/index.php/2007/02/11/fixing-software-suspend-hibernate-with-uswsusp-in-ubu... [...]
Fixing software suspend / hibernate with uswsusp in Ubuntu Feisty (and Edgy)
19 Jun 07 at 5:05 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
pearsonbe
22 Jun 07 at 7:37 pm
Thanks, work juste fine on my Thinkpad t60p.
gagarine
29 Jun 07 at 3:56 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.
Django
6 Jul 07 at 3:57 am
`aptitude install uswsusp` did it for me on my Thinkpad R50e (feisty)! no need to copy over the hal-files!
Kai
13 Jul 07 at 5:54 am
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,
Tien
13 Jul 07 at 8:04 pm
[...] Źródło: http://blog.paulbetts.org [...]
Problem z usypianiem / hibernacjÄ… w Ubuntu Feisty Fawn (Dell Inspiron E1505/6400).
14 Jul 07 at 2:01 pm
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.
William M
26 Jul 07 at 7:28 am
Works fine on HP nc2400 (Feisty, kernel 2.6.20-16). Thanks a lot.
Pascal
3 Aug 07 at 4:10 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.
omjoi
5 Aug 07 at 4:39 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?
hitch
16 Aug 07 at 4:01 am
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=$?
kallistra
17 Aug 07 at 10:16 pm
Wow, this is the perfect solution to my Dell Inspiron 1501 hibernation problems! Thanks for the tip!
William
17 Aug 07 at 11:22 pm
Almost perfect. The sound doesn’t come back
William
17 Aug 07 at 11:27 pm
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.
omjoi
19 Aug 07 at 5:52 am
@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).
Paul Betts
19 Aug 07 at 8:23 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’
quin
25 Aug 07 at 6:06 pm
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.
Maverick
29 Aug 07 at 4:22 am
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.
Ric
1 Sep 07 at 11:43 pm
@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)
Paul Betts
2 Sep 07 at 12:20 am
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?
sberla
6 Sep 07 at 4:15 pm
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).
Vadim P.
13 Sep 07 at 6:52 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?
Dan
19 Sep 07 at 5:37 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”.
sindhu
21 Sep 07 at 8:26 am
uswsusp works pretty well on my thinkpad r60e, feisty.
think you.
hela
29 Sep 07 at 8:56 pm
[...] http://blog.paulbetts.org/index.php/2007/02/11/fixing-software-suspend-hibernate-with-uswsusp-in-ubu... [...]
Zechs 㮠BLOG » Ubuntu Diary : Suspend and Hibernate with µswsusp
2 Oct 07 at 7:25 pm
[...] http://blog.paulbetts.org/index.php/2007/02/11/fixing-software-suspend-hibernate-with-uswsusp-in-ubu... suggests to Download these two files: [...]
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
4 Oct 07 at 5:39 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
Michele
7 Oct 07 at 7:24 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!)
Paul Betts
8 Oct 07 at 12:34 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
Michele
8 Oct 07 at 3:53 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?
Benoit Labourdette
13 Oct 07 at 2:41 am
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…)
pyro
14 Oct 07 at 5:15 pm
@pyro: It could be that you’ve corrupted some system files. Try booting in recovery mode and running fsck
Paul Betts
14 Oct 07 at 7:53 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.
pyro
15 Oct 07 at 7:55 pm
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.
eli
31 Oct 07 at 10:21 am
this works for my T60p on Gutsy.
Many thanks for this solution.
cheezo
13 Nov 07 at 10:56 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?
Articles
21 Nov 07 at 6:54 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
Max
6 Jan 08 at 5:51 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
Max
6 Jan 08 at 6:36 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?
GOwin
23 Jan 08 at 6:56 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.
Mackenzie Cyr
18 Feb 08 at 7:47 am
[...] Fixing software suspend / hibernate with uswsusp in Ubuntu Feisty (and Edgy) [...]
Demenzia.net – Using suspend to disk with eeeXubuntu on a eeePC
21 Feb 08 at 7:22 pm
THanks!
THis works on my Ubuntu 7.10; AMD 62 x2 4000+. Nvidia 6100
ano
22 Feb 08 at 6:28 am
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.
Johannes Midgren
17 Mar 08 at 5:42 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 [...]
Linux Erfahrungsbericht « Tom’s Webbox
25 Mar 08 at 7:26 pm
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…)
Bob/Paul
28 Apr 08 at 11:19 am
Found out the best way of fixing the issue is installing pm-utils… apparently no script necessary…
sohbet
30 Apr 08 at 6:12 am
[...] 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 [...]
How To Install Ubuntu 8.04 Hardy Heron On The Asus M50Sv-A1 « See This, Now Read This
19 May 08 at 6: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
jrobbo
31 May 08 at 11:17 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
arcx
6 Jun 08 at 5:27 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
nomasteryoda
17 Aug 08 at 10:39 pm
[...] make this the default way of suspending check out the this guide. It was written for Feisty and Edgy, but it does work for Gutsy as [...]
Asus G1S Wiki: Ubuntu 7.10 on Asus G1S
4 Sep 08 at 3:44 pm
[...] make this the default way of hibernating check out the this guide. It was written for Feisty and Edgy, but it does work for Gutsy as [...]
Asus G1S Wiki: Ubuntu 8.04 on Asus G1S
10 Sep 08 at 9:55 am
good
情趣用å“
9 Nov 08 at 2:09 am
Success on Ubuntu 8.04 (Hardy Heron) on an IBM ThinkPad R51, using the ‘dpkg-divert –divert /usr/sbin/s2disk –rename /sbin/s2disk’ command added in a comment above (note that the commenter did not use double single dash characters in front of his dpkg options, so you need to replace the long-single-dashes he used if copy-pasting).
The only issue I encountered is that I have to reset the current network (System -> Administration -> Network; unlock, reset current location profile (i.e., “Home” or “Work”, and so forth), and click ‘Close’). Otherwise, Internet access doesn’t work.
Christopher M. Balz
3 Jan 09 at 8:27 pm
Note: The networking issue I mentioned in the comment above appears to be unrelated and happens only rarely. Also the dash problem I mentioned above is due to a WordPress (blog-publishing software) bug.
Here is what I did from the top: To get hibernate to work on Hardy Heron, I followed the procedure set out by Paul Betts in the blog post, then since I am on Hardy and it still was not working, as stated above I followed the directions in the comment by Bob/Paul on 28 Apr 08 at 11:19 am. Running Ubuntu 8.04 (Hardy Heron) on an IBM ThinkPad R51 (a laptop), using the ati(flgrx) video card driver.
Still no luck with suspend – - any ideas?
A bit of history: Hibernate used to work when I could use the vesa driver for the ati video card in this laptop, but lately updates seem to have broken that. Also, I run an external monitor as a single head when the laptop is “docked”, and getting the proper resolution there seems to limit driver choice. So I had to switch back to the ati drivers. Seems like somehow, the issue of video driver needs to be separated out in the underlying code from saving state.
All in all, having hibernate work again is a good thing.
Christopher M. Balz
4 Jan 09 at 2:21 pm
Still no joy with the USB…
After a reboot everything works and I issue the commands
sudo /sbin/rmmod uhci-hcd
and
sudo /sbin/modprobe -s -k uhci-hcd
I can swithc off and on again the USB ports (mouse and usb drive).
The very same commands don’t have any effect after a suspend or an hibernate.
This is dmesg output after suspend and after having issued the two commands:
[ 3286.908000] PCI: Setting latency timer of device 0000:00:1d.1 to 64
[ 3286.908000] uhci_hcd 0000:00:1d.1: UHCI Host Controller
[ 3286.908000] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 2
[ 3286.908000] uhci_hcd 0000:00:1d.1: irq 11, io base 0×00001820
[ 3286.908000] usb usb2: configuration #1 chosen from 1 choice
[ 3286.908000] hub 2-0:1.0: USB hub found
[ 3286.908000] hub 2-0:1.0: 2 ports detected
[ 3287.012000] ACPI: PCI Interrupt 0000:00:1d.2[C] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
[ 3287.012000] PCI: Setting latency timer of device 0000:00:1d.2 to 64
[ 3287.012000] uhci_hcd 0000:00:1d.2: UHCI Host Controller
[ 3287.012000] uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 3
[ 3287.012000] uhci_hcd 0000:00:1d.2: irq 11, io base 0×00001840
[ 3287.012000] usb usb3: configuration #1 chosen from 1 choice
[ 3287.012000] hub 3-0:1.0: USB hub found
[ 3287.012000] hub 3-0:1.0: 2 ports detected
many thanks in advance!
omjoi
5 Jan 09 at 7:35 am
[...] > To poprosze sterowniki do sleep/hibernate dla mojego laptopa HP NC2400. Prosze: µswsusp http://blog.paulbetts.org/index.php/…isty-and-edgy/ "Works fine on HP nc2400 (Feisty, kernel 2.6.20-16)" — Dominik (& k
Maria
18 Jan 09 at 10:29 am
i dunno why but it would appear that in intrepid the s2ram command has been removed in the uswsusp package, what do you suggest i use as a replacement? there appears to be a “s2both” command, but that does nothing more than s2disk
John Pycroft
11 Feb 09 at 8:08 am
Ubuntu, LG M1 Pro (M1-JDGFG) und Suspend/Hibernate…
Update: Unter Ubuntu 8.04 läuft Suspend und Hibernate ohne Probleme auf meinem M1-JDGFG.
Suspend to Disk funktioniert auf dem M1-JDGFG so ähnlich, wie im Blog von Paul Betts beschrieben:
Man installiert uswsusp: sudo apt-get install uswsusp
Man kann…
Max' Tagebuch
23 Apr 09 at 9:53 am
[...] Grafiktreibers beim wiedereinschalten nur einen Schwarzen Bildschirm zeigte bin ich auf folgenden Tipp gestoßen: Man nutzt statt des integrierten Modus das Programm uswsusp. Bevor man dieses aber [...]
Linux Erfahrungsbericht – TkNotes
8 May 09 at 2:54 pm