To those of you who are still struggling to get hibernate working on your machine, you may want to try the method that I've applied on some computers. Please note that this method is only necessary if you need to have nVidia restricted driver (particularly version 96.xx) installed and Compiz enabled .
1. Edit /etc/X11/xorg.conf to add “NvAGP” “1” and “nologo” “1” driver options
Let's make a backup of the file before altering it:
- Code: Select all
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old
And then open the (original) file for editing:
- Code: Select all
gksu gedit /etc/X11/xorg.conf
Scroll down to the “Device” section then add both options right below the line that reads Driver "nividia". Here is a sample from my xorg.conf:
Section "Device"
Identifier "Configured Video Device"
Boardname "nvidia"
Busid "PCI:1:0:0"
Driver "nvidia"
Option "NvAGP" "1" <=
Option "nologo" "1" <=
Screen 0
EndSection
*Please Note*
If your computer becomes unstable or if graphics gets corrupted after adding the NvAGP option, you may want to blacklist the AGPGART module. You simply have to add it into the blacklist file:
- Code: Select all
sudo cp /etc/modprobe.d/blacklist /blacklist.old; sudo echo 'blacklist agpgart' >> /etc/modprobe.d/blacklist
Then reboot your computer.
If you get worse performance and/or stability after rebooting with AGPGART turned off, you can restore the original blacklist file using this command:
- Code: Select all
sudo cp /blacklist.old /etc/modprobe.d/blacklist
2. Open /etc/default/acpi-support to add post_video=false and vbe_save_state=false:
- Code: Select all
gksu gedit /etc/default/acpi-support
Use mine as reference:
# Should we save and restore state using the VESA BIOS Extensions?
#SAVE_VBE_STATE=true
SAVE_VBE_STATE=false <=
# The file that we use to save the vbestate
VBESTATE=/var/lib/acpi-support/vbestate
# Should we attempt to warm-boot the video hardware on resume?
#POST_VIDEO=true
POST_VIDEO=false <=
*Remember to comment out the default settings before making any modifications.*
3. Disable Vsync in Compiz:
System > Advanced Desktop Effects Settings > General Options, go to the Display Settings tab and clear the checkbox next to Sync to Vblank.
4. Better reboot your computer now.
5. Check your swap partition (you need to have a properly set up swap partition in order to get hibernate working):
- Code: Select all
swapon -s
You should get something like this:
Filename Type Size Used Priority
/dev/sdb8 partition 2048184 0 1
If you get any number lower than 1 (i.e. a 0 or any negative values) under Priority, then you have to do some additional steps to change it to 1. Otherwise, skip the steps below and jump right to step 7: Install uswsusp.
6. If you get a 0 or negative value for your swap partition priority, then edit your /etc/fstab to make a little adjustment in it:
- Code: Select all
gksu gedit /etc/fstab
And make it look like this (just add the text in bold into yours):
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sdb9
UUID=1e603731-5088-4e2f-b239-399b51e437c1 / ext3 relatime,errors=remount-ro,data=writeback 0 1
# /dev/sdb8
UUID=19fcf2e9-ed0d-4d6f-ba27-ad3821d8d533 none swap pri=1 0 0
Now save the modification, and disable swap partition:
- Code: Select all
sudo swapoff -a
Now re-enable it:
- Code: Select all
sudo swapon -a
It should have the correct priority value now, check to make sure:
- Code: Select all
swapon -s
7. Install uswsusp:
- Code: Select all
sudo apt-get install uswsusp
You should now be given several questions to configure uswsusp. Basically you simply have to define the swap partition you would like uswsusp to use for storing the memory dump, console loglevels, etc. Use the partition that appeared when you entered the command swapon -s.
Use my uswsusp configuration as reference:
- Code: Select all
cat /etc/uswsusp.conf
resume device = /dev/sdb8
image size = 587737425
suspend loglevel = 2
max loglevel = 2
RSA key file = /etc/uswsusp.key
shutdown method = platform
If uswsusp configuration screen doesn't appear after installation, then call it manually:
- Code: Select all
sudo dpkg-reconfigure uswsusp
8. You may want to check your kernel configuration file to make sure it has the correct settings.
- Code: Select all
gksu gedit /boot/config-2.6.24-generic
Check if it has the following lines:
CONFIG_SOFTWARE_SUSPEND=y
(Note: I don't see this one in my kernel configuration file but I can still put the computer into hibernation)
CONFIG_BLK_DEV_INITRD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=65536
(Note: minimum value needed by uswsusp is 2048. If you see higher value there, just leave it as it is)
CONFIG_BLK_DEV_LOOP=y
(Note: mine is set to CONFIG_BLK_DEV_LOOP=m but s2disk seems to work properly)
For more information about kernel configuration file parameters required by uswsusp, you can consult the uswsusp Howto which is stored in /usr/share/doc/uswsusp/HOWTO.gz.
Note: Should you need to perform any adjustment to your kernel configuration file, please make a backup before doing so.
9. Edit your /boot/grub/menu.lst file to add boot option required by uswsusp:
- Code: Select all
gksu gedit /boot/grub/menu.lst
Add resume=/dev/sdxn boot option, where sdxn is your swap partition. For example, since my swap partition is /dev/sdb8, my final menu.lst file now looks like this:
## ## End Default Options ##
title Linux Mint, kernel 2.6.24-16-generic
root (hd1,8)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb9 rootflags=data=writeback ro quiet splash resume=/dev/sdb8
initrd /boot/initrd.img-2.6.24-16-generic
title Linux Mint, kernel 2.6.24-16-generic
root (hd1,8)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb9 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
title Linux Mint, kernel 2.6.24-16-generic (recovery mode)
root (hd1,8)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb9 ro single
initrd /boot/initrd.img-2.6.24-16-generic
title Linux Mint, kernel memtest86+
root (hd1,8)
kernel /boot/memtest86+.bin
### END DEBIAN AUTOMAGIC KERNELS LIST
10. Reboot your computer.
11. Once you're back in the Gnome desktop, check if the kernel gets the boot option:
- Code: Select all
dmesg | grep command
If you see resume=/dev/sdxn boot option in the output line, proceed to the next step. This is what I get by entering the above command, for your reference:
[ 0.000000] Kernel command line: root=/dev/sdb9 rootflags=data=writeback ro resume=/dev/sdb8
12. Test if hibernate works:
- Code: Select all
s2disk
Your computer should now be on its way to hibernation. It's hibernated once the power supply turns off. <=not that I underestimate your intelligence
Note: if you see an error message “s2disk: Could not lock myself. Reason: Cannot allocate memory” by entering the above command, then try:
- Code: Select all
sudo s2disk
13. Turn your computer back on and to see if your desktop session is restored the way it was right before the hibernation. If it is, then congratulations! You now have hibernate.
14. You now have to make the s2disk command get invoked when you initiate hibernation from System > Quit > Hibernate (or by pressing an appropriate button on your laptop/desktop case). To do that, we have to edit one more file.
First, make a backup copy of the file you're going to edit:
- Code: Select all
sudo cp /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux.bak
Edit the file /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux:
- Code: Select all
gksu gedit /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux
Add the following line into it, right below #!/bin/sh and delete everything else except exit $RET:
- Code: Select all
/sbin/s2disk
See mine for reference:
- Code: Select all
#!/bin/sh
/sbin/s2disk
exit $RET
Finally, Go to System > Quit . . . > Hibernate. And click on Hibernate.
That was how I got hibernate working on some machines. Good luck!
Additional informations:
1. If your computer goes into hibernation without completely powering off, you may want to try the solution offered by cbaltar2. Simply read the succeeding posts in this page and you should spot it easily.
2. Some of you may see minor glitches when your computer comes out of hibernation, such as window title bars and decorations turning white/gray or nautilus opening up windows for attached removable drives. Please check page 2 of this thread to see some safe ways to workaround them.









