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
Code: Select all
gksu gedit /etc/X11/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
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
Code: Select all
gksu gedit /etc/default/acpi-support
# 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
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
# <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
Code: Select all
sudo swapon -a
Code: Select all
swapon -s
Code: Select all
sudo apt-get install uswsusp
Use my uswsusp configuration as reference:
Code: Select all
cat /etc/uswsusp.conf
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
Code: Select all
gksu gedit /boot/config-2.6.24-generic
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
## ## 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
[ 0.000000] Kernel command line: root=/dev/sdb9 rootflags=data=writeback ro resume=/dev/sdb8
12. Test if hibernate works:
Code: Select all
s2disk
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
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
Code: Select all
/sbin/s2disk
Code: Select all
#!/bin/sh
/sbin/s2disk
exit $RET
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.