Debian – Hibernation resume fail on linux kernel 4.9.0, Debian 9

debianfstabhibernateinitramfslinux-kernel

I recently upgraded my kernel from 3.16.4 (Debian jessie) to 4.9.0 (Debian stretch).
Everything was fine, until I tried to "Hibernate" (suspend to disk).

When I use Hibernate option in LXDE, it appears to hibernate. I can hear the disk spindle ticking and writing data. But the problems appears when resuming from hibernation. The kernel successfully restores the image from swap, but then freezes and reboots, with all that work lost. I could not find answer anywhere on internet. The people are just solving some mistakes around not setting /etc/initramfs-tools/conf.d/resume or have set kernel paramters, or have wrong entry in /etc/fstab. I have these correct. Correct UUID in /etc/initramfs-tools/conf.d/resume, correct fstab and not set resume kernel paramter.

  • I moved the swap partition outside of the extended partition to primary. The UUID was saved and applied to the new swap.

  • The system reaches "Restoring image 100%" and then "Suspending consoles", and then it powers off and boots normally, with all work lost.

  • Tried clean install, but without luck.

  • Happens only on i386 (32-bit x86), amd64 (64-bit x86) does not suffer.

Disk partition table layout:

NAME   FSTYPE LABEL    UUID                                 MOUNTPOINT
sda                                                         
├─sda1 ext4   HDD      <ROOT-UUID> /
└─sda2 swap   HDD-SWAP <SW-UUID> [SWAP]
sr0

The sda2 was logical(resides-inside-extended) before the upgrade.

Fstab:

UUID=<ROOT-UUID> / ext4 errors=remount-ro 0 1
UUID=<SW-UUID> none swap sw 0 0

/etc/initramfs-tools/conf.d/resume

RESUME=UUID=<SW-UUID>

Kernel cmdline

BOOT_IMAGE=/boot/vmlinuz-4.9.0-3-686-pae root=UUID=<ROOT-UUID> ro quiet

System information:

Computer: Compaq CQ60-120ec
Swap Size: 3.5GiB
Processor: AMD Athlon X2 64 QL-66
GPU: Nvidia Geforce 8200M G
Memory: 2G DDR2 667MHz
Desktop Environment: LXDE
Debian Version: 9 (stretch)
Kernel version: 4.9.0-3
Graphics Driver: nvidia legacy 304xxx

(I know the processor is 64bit but it came with 32bit os originally, so I thought it was 32bit until I examined /proc/cpuinfo)

Best Answer

The issue is due to a conflict between hibernate and kASLR on x86-32. This can be solved by disabling kASLR with the nokaslr kernel boot option. x86-64 is not affected.

For Grub this can be done by editing /etc/default/grub and adding nokaslr to the boot options, e.g.: GRUB_CMDLINE_LINUX_DEFAULT="quiet nokaslr"

Then run update-grub to update the configuration and reboot to give it a try.


I had exactly the same issue and it seems that only the PAE kernel is affected by that issue. The same kernel without PAE works without issues.

The workaround for me was to install linux-image-686 and uninstall linux-image-686-pae and linux-image-4.9.0-4-686-pae. The exact kernel version may change over time due to upgrades, but basically the currently running PAE kernel need to be replaced with a kernel without PAE.

It has actually nothing to do with PAE support of the CPU, as my CPU supports PAE according to /proc/cpuinfo. But PAE is anyway not of much use on old notebooks.

It has also nothing to do with kernel 4.9 PAE as the same issue happens with kernel 4.13 PAE from Debian backports.

Related Question