One of the little annoyances of the Buntus is they don’t have hibernation enabled by default; you have to set it up yourself. This entails a few extra steps, fortunately these are fairly straightforward.
- Find the UUID of the swap partition with this command:
blkid - edit the grub settings files /etc/default/grub and find the following line:
GRUB_CMDLINE_LINUX_DEFAULT
on the end of that line add the following textresume=UUID=<UUID>
where <UUID> is from the result of the command in step 1 - run update-grub to update the grub configuration with the new setting
- In a root shell type nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla and enter all the text below
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
After you reboot, hibernation should work correctly.
There is an interesting possibility implicit that a specific partition can be set aside just for the hibernation. So far I haven’t tried this, but it would look attractive in cases where the swap space is all used up by applications, as the system will not hibernate in these instances.