Well, I've done following and I am very surprised that it worked, even though I use full encryption Am I doing something wrong?
First, I use the default LUKS encrypted scheme with LVM and I have 64G of RAM.
So I have reduced the size of the root partition by about 100G with the live USB stick (this doesn't work live). Make sure to unlock LUKS before using the Disks tool of ZorinOS, then reduce the LVM size:
sudo lvreduce --resizefs --size -100G /dev/mapper/vgzorin-root
The --resizefs
is important as you want your filesystem be shrinked before the LVM size is reduced.
After that I temporarily disabled the swap:
sudo swapoff /dev/mapper/vgzorin-swap_1
Then I changed the size to my RAMs size:
sudo lvresize -L 64G /dev/mapper/vgzorin-swap_1
Then I formatted the swap:
sudo mkswap /dev/mapper/vgzorin-swap_1
After that, I changed following line in /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to following:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/mapper/vgzorin-swap_1"
As you can see, I wasn't required to use an UUID for the resume
option, instead I used /dev/mapper/vgzorin-swap_1
.
Then I updated grub:
sudo update-grub
And then I tested hibernation with following command:
sudo systemctl hibernate
My PC shut off, even the RAM RGB turned off (this would usually be turned on if only in standby). Pressed a button on a keyboard and the PC immediately started. It booted normal and then the LUKS crypto prompt came for the key.
So it seems this works even with LUKS encryption enabled?
If I don't miss something, it would be great to allow users to change the swap partition size during installation because hibernation instead of standby is great!