Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Ubuntu 11.10 on my machine and I notice several problems with the Hibernate functionality. When I use s2disk/pm-hibernate, I see an embarrassingly slow wakeup from the hibernate state. I am talking on the order of 5-6 minutes when Windows 7 on the same system resumes within 1 minute even when I hibernate with a slightly loaded system. But this slow resume from hibernate is unacceptable and I would be glad if someone can help me repair it. I have a Core i5 processor with 8GB RAM. I have set about 6GB of hard disk space for swap. It would be helpful if someone can help me identify and rectify the bottleneck in the resume process.

Also with Windows 7 I was able to setup my system to wake up from hibernate state automatically at a specified time. But I am not able to get the same functionality running on linux. I am following this Automatic System Wakeup Guide.

Thanks for your help!


Interesting observation from /var/log/kern.log

During s2disk stage: I see the following log message:

Jan 16 01:38:00 pc kernel: [10682.575070] PM: Preallocating image memory... done (allocated 1902274 pages)
Jan 16 01:38:00 pc kernel: [10706.894027] PM: Allocated 7609096 kbytes in 24.33 seconds (312.74 MB/s)

This seems to be the bottleneck of s2disk stage.

During resume the only time consuming steps as per kern.log are:

Jan 16 01:38:01 pc kernel: [10709.361876] video LNXVIDEO:00: Restoring backlight state
Jan 16 01:38:13 pc kernel: [10726.919537] wlan0: authenticate with c0:c1:c0:f0:68:6b (try 1)

This takes 12 seconds.

Jan 16 01:38:15 pc kernel: [10728.620666] [drm:drm_mode_getfb] *ERROR* invalid framebuffer id
Jan 16 01:38:17 pc kernel: [10730.903990] wlan0: deauthenticated from *:*:*:*:*:6b (Reason: 15)

This takes 2 seconds.

Jan 16 01:38:17 pc kernel: [10730.967287] cfg80211: Calling CRDA to update world regulatory domain
Jan 16 01:38:19 pc kernel: [10732.265611] wlan0: authenticate with *:*:*:*:*:6b (try 1)

This takes 2 seconds.

Jan 16 01:38:19 banga-pc kernel: [10732.271086] wlan0: associated
Jan 16 01:38:35 banga-pc kernel: [10748.866054] cfg80211: Ignoring regulatory request Set by core since the driver uses its own custom regulatory domain
Jan 16 01:38:35 banga-pc kernel: [10748.866063] cfg80211: World regulatory domain updated:

This takes 16 seconds.

Rest all the log messages are closely spaced in time. This does not explain the 5-6 minute resume time. Also after about 2 minutes of power on I do see the windows and everything but the system takes about 3-4 minutes to become usable. Until then I do not see the mouse pointer and the keyboard does not work. The screen remains frozen until then as if waiting on sudo s2disk I had issued before hibernating the system.

Strange but I do need help to fix this soon. I am used to < 30 seconds resume time and restarting my computer < once per week. I would be delighted if I could get the same with Ubuntu. I also need help to fix the ACPI Wakeup thing I mentioned above.

In case it matters I have an integrated Intel graphics card on my laptop.

share|improve this question
You might want to try tuxonice , it's much better than original implemention , like compression and a UI available – warl0ck Jan 16 '12 at 7:15

The bottle neck is that you have to write 8 GB of RAM to disk, worse yet you have to sort through 6 GB of swap to determine which data goes with what. Maybe try shrinking the swap partition (or removing it entirely, you have enough RAM) and see if that helps at all. Otherwise, we'll need to see some log files. man dmesg and man syslog

It could also be stubborn hardware. Hard to say at this point.

share|improve this answer
I tried swapoff -a and that stops hibernate altogether. Whats with this? If I have sufficient RAM, then the swap may not be in use under routine usage of the system. (swapon -s shows 0 in use). Why would the hibernate process worry about swap space then? – Rohit Banga Jan 16 '12 at 4:44
s2disk: Could not use the resume device (try swapon -a). Reason: No such device – Rohit Banga Jan 16 '12 at 4:57
It was my understanding that the linux kernel does not need swap at all to operate (although it speeds things up considerably) this understanding may no longer be true. – Huckle Jan 16 '12 at 5:08 this site seems to indicate that (for swsusp) turning the swap off and then on again will speed up resumes. – Huckle Jan 16 '12 at 5:09 here is some info about the conf file used for s2disk (from your comment) there is a setting in there to make the saved image as small as possible. There is also another setting to increase verbosity in the logfiles. – Huckle Jan 16 '12 at 5:14

Just resize swap to 8GB because during hibernation the RAM data write into swap. How many data is able to write to swap now? 6 GB. How many data maybe writing to RAM? 8 GB. 8 minus 6 is 2 missed GB.

share|improve this answer
Well I have two contradicting answers (this and @Huckle's) ... can you please offer some citation? Also I do not have additional space on my harddisk. – Rohit Banga Jan 16 '12 at 4:47
Going through this ubuntu page on swap space ( What you said does seem to be true? I do not have additional space on my hard disk, can I use a swap file instead. – Rohit Banga Jan 16 '12 at 5:14
I don't think it is likely he has 8 GB of active RAM usage. In addition recent suspend programs generally don't save every single detail, they'll send signals out to programs to dump unused memory first. Also, on that ubuntu help page it has an example for 'high ram, low disk' where the swap is smaller than the RAM. – Huckle Jan 16 '12 at 5:15
You can always boot to a live CD and use gparted to shrink filesystems to make room for a few GB more swap. – Huckle Jan 16 '12 at 5:18
I will try gparted ... just to add I have a dual boot system with an extended partion in windows. Part of this extended partition contains a logical drive formatted in ntfs. It stores my data. The rest of the extended partition contains ext4 and swap partitions. I have to use a swap partitions as three of my partitions are reserved by Dell Utility, Windows Recovery and Windows 7 OS. I cannot have a separate primary partition as then I will not be able to keep my data in a separate partition (limit of 4 primary partitions) hence this weird setup. – Rohit Banga Jan 16 '12 at 5:42

You should check your swappiness value. Usually it is left at 60. It should be 10 or 15:

cat /proc/sys/vm/swappiness

You can change it on the fly with

sudo bash -c "echo -e 10 > /proc/sys/vm/swappiness"

and make it stick with

sudo bash -c "echo 'vm.swappiness = 15' >> /etc/sysctl.conf"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.