Enabling Hibernation into a LVM/LUKS swap partition on Linux Mint 22.1 Xia
I wanted to have my Thinkpad x220 running Linux Mint 22.1 „Xia” to hibernate into a LVM/LUKS partition to save more battery power then just doing a „suspend”. Unfortunately, with Xia being based off Ubuntu 24.04 LTS, the procedure is not straight forward. But I got it working.
Get the name of your swap partition by grepping the /etc/fstab:
$ grep swap /etc/fstab /dev/mapper/vgmint-swap_1 none swap sw 0 0
Modify the /etc/default/grub file, so that the „GRUB_CMDLINE_LINUX_DEFAULT” has a „resume” entry pointing to the swap partition:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/mapper/vgmint-swap_1"
and regenerate grub:
$ sudo update-grub2
Reboot and then try to engage hibernate:
$ sudo systemctl hibernate
Once, that works, we need to include „hibernate” into the power menus of Xia. This is done in newer Ubuntu and therefore Linux Mint versions via a policy rule:
cat << __UND_AUS__ > /etc/polkit-1/rules.d/10-enable-hibernate.rules polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.login1.hibernate" || action.id == "org.freedesktop.login1.hibernate-multiple-sessions" || action.id == "org.freedesktop.upower.hibernate" || action.id == "org.freedesktop.login1.handle-hibernate-key" || action.id == "org.freedesktop.login1.hibernate-ignore-inhibit") { return polkit.Result.YES; } }); __UND_AUS__
And presto, everything works as expected.
Sources:
- Enable Hibernation with LUKS on LVM and extras. - Linux Mint Forums
- Mint 22 enable hibernation in power and shutdown menu - Linux Mint Forums
- How to Enable Hibernate Function in Ubuntu 24.04 & 22.04 LTS | UbuntuHandbook
Tagged as: hibernation, it, linux, mint, suspend, yakshaving | Author: Martin Leyrer
[Samstag, 20250705, 14:39 | permanent link | 0 Kommentar(e)