Hibernate on Debian with LVM ond LUKS

For some time I was looking for a solution to a strange problem:

My Laptop has an encrypted partition which contains two logical volumes: root and swap. According to the well-known practice I added the parameter resume=/path/to/swap to /etc/default/grub. Suspend worked, but the system did not resume. Even dmesg did not give any useful information. Actully it did not report that it tried to resume from somewhere. Some time passed reading lots of websites about setting up LVM on LUKS using kernel parameters without notable success.

Today I digged into the man pages of dracut, but there is not written how to set up resuming at all. Finally I came across the command line parameters “--list-modules” and “--print-cmdline”. The latter revealed that dracut indeed does not see any resume parameter, while the former sais that the module “resume” is installed. But somehow it was not loaded.

After some further investigation of dracut.conf parameters I found out, that I can enable modules, when I create a file named “/etc/dracut.conf.d/20-resume.conf” with the following contents:
add_dracutmodules+=" resume "
Please, note the spaces around resume.
After that I ran “dracut” and “update-grub” and finally the resume parameter was also written to the dracut command line parameters. And resuming seems to work now.

Fazit: I don't know how to set up resuming from a LVM swap partition on a LUKS encrypted partition. But, I know that you must enable the module “resume” as a precondition to do that.