Making Hibernate work on Ubuntu 22.04 (jammy) on the Framework Laptop w/full disk encryption
Making Hibernate work on Ubuntu 22.04 (jammy) on the Framework Laptop w/full disk encryption
The first step is to make a swapfile large enough for your device to suspend to.
sudo swapoff /swapfile
sudo dd if=/dev/zero of=/swapfile bs=$(cat /proc/meminfo | awk '/MemTotal/ {print $2}') count=1024 conv=notrunc
sudo mkswap /swapfile
sudo swapon /swapfile
Then make sure it's enabled on reboot, e.g: echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab
If there is another swap partition or file in /etc/fstab you may need to take it out.
Find the device your swapfile is located on (e.g. findmnt -no source -T /swapfile), note here some guides recommend using the UUID, in my experience, this resulted in some errors.
To find the resume offset of your file run filefrag -v /swapfile and then look at the first value under physical_offset.
Set `GRUB_CMDLINE_LINUX_DEFAULT="splash resume=${RESUME_DEVICE} resume_offset=${RESUME_OFFSET} nvme.noacpi=1"` in `/etc/default/grub` and then update grub with sudo update-grub
If you want to enable hibernation on lid close set `HandleLidSwitch=hibernate` in `/etc/systemd/logind.conf`.
Comments