Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ubuntu 11.10 Thinkpad T61p with 120 GB free disk space and 2 GB memory.

I got this error message while trying to activate hibernation mode. Not enough free memory Error 12 - creating hibernation image

Is this a bug or what may I do to have hibernation and sleep mode working properly?

Edit:

             total       used       free     shared    buffers     cached
Mem:          1996       1450        545          0        139        359
 -/+ buffers/cache:       951       1044
Swap:         2027          0       2027
share|improve this question
add comment

4 Answers

Did you install without a swap partition? IIRC it doesn't save to an in use partition -- hence free space not mattering. Check swap space usage:

aking1012@devlaptop:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          3931       1923       2007          0        154        916
-/+ buffers/cache:        852       3078
Swap:         4059          0       4059

Free swap has to be > total Mem for hibernation to work.

Best practice is double RAM as swap. Might try that first(I know, I didn't do it). But then, I don't use hibernate on this box so...

Then if it doesn't work, file a bug report like this.

share|improve this answer
    
This is my info: hcf@hcf-ThinkPad-T61p:~$ free -m total used free shared buffers cached Mem: 1996 1450 545 0 139 359 -/+ buffers/cache: 951 1044 Swap: 2027 0 2027 –  Hurumhei Mar 15 '12 at 8:12
    
I am new to Ubuntu - how do I do that? –  Hurumhei Mar 15 '12 at 8:18
    
Although I managed to set new swap setting to: hcf@hcf-ThinkPad-T61p:~$ free -m total used free shared buffers cached Mem: 1996 1456 540 0 103 369 -/+ buffers/cache: 982 1014 Swap: 4075 0 4075 , the problem persist. Screen freezes and/or get error message. –  Hurumhei Mar 15 '12 at 19:53
    
Typically you want to put command output in your question as an edit. you also typically want to wrap them in <pre></pre> so it's obvious that it's command output instead of posting it in the comments like I did for you the first time. This way you keep columns and such. Like I said in the answer already. I think you need to file a bug report like in the answer. –  hbdgaf Mar 15 '12 at 20:50
add comment

Ubuntu 12.04

To make the setting

echo 0 > /sys/power/image_size

persistent, you need a script.

sudo touch /usr/lib/pm-utils/sleep.d/100_owner_actions

sudo chmod +x /usr/lib/pm-utils/sleep.d/100_owner_actions

sudo nano /usr/lib/pm-utils/sleep.d/100_owner_actions

Put the following code in the new file 100_owner_actions:

#!/bin/sh
##
## 100_owner_actions
##
case $1 in
suspend)
## COMMANDS THAT YOU WISH TO RUN BEFORE SUSPEND
#COMMAND1
;;
resume)
## COMMANDS THAT YOU WISH TO RUN AFTER RESUME
;;
hibernate)
## COMMANDS THAT YOU WISH TO RUN BEFORE HIBERNATE
#COMMAND3
echo 0 > /sys/power/image_size
;;
thaw)
## COMMANDS THAT YOU WISH TO RUN AFTER RESUME FROM SUSPEND TO DISK
#COMMAND4
;;
esac
share|improve this answer
add comment

My system hibernated in approximate 50% of attempts:

MemTotal:        6053820 kB
MemFree:         5016480 kB
Buffers:           29744 kB
Cached:           277564 kB
SwapCached:       203160 kB
Active:           323360 kB
Inactive:         571640 kB
Active(anon):     249700 kB
Inactive(anon):   382724 kB
Active(file):      73660 kB
Inactive(file):   188916 kB
Unevictable:          32 kB
Mlocked:              32 kB
HighTotal:       5236572 kB
HighFree:        4335756 kB
LowTotal:         817248 kB
LowFree:          680724 kB
SwapTotal:       7811068 kB
SwapFree:        7312116 kB

It seems that setting image size to 0 solved my problem:

echo 0 > /sys/power/image_size

I guess that it suppose to write the smallest image possible.

share|improve this answer
add comment

I think that this problem exist when Swap partition is too small.

Try making it bigger with e.g. GParted. Double size of Your RAM should be enough.

After this step you may have problems with UUID of Swap partition. If You notice errors during boot time about missing partition You will have to edit /etc/fstab . Ask if You will need more info.

share|improve this answer
add comment

Your Answer

 
discard

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.