I’m on Ubuntu 23.04 and I’m trying to enable hibernate (so I can use it instead of suspend, given how much suspend drains battery).
Everything I find online points to this thread to explain how to enable hibernate if it is not enabled on our system. However, this is way above my technical understanding–there is no easy step-by-step explanation on how to do it.
Has anyone does this on Ubuntu on the Framework? If so, how?
While we do not test or support it officially, this will probably get you going.
It’s quite involved (I’ve done it before on 12th gen), and it may lead to additional challenges if you miss a step.
I am not using the hibernate function on laptops with Linux anymore:
I use laptops with large RAM amount 32 or 64 GB ram. Means the SWAP space will have to be at least that large and IMHO, this is a waste of disk space.
The boot up process is very fast under Linux.
That was an issue with Windows taking ages to boot where hibernation was a thing.
If I’m on travel and working on some things, I just put it to sleep as I’ll continue 30 minutes later where I stopped.
As a counter point, being able to not have to open and position windows particular to your workflow is something I value. Hibernation works REALLY well on the 11th and 12th Frameworks that I own. It is just a matter of increasing the size of the swap file, updating grub, and adding the GUI elements back into Gnome.
Beyond this you now have several options when finished using your laptop. Suspend, hibernation, or power off.
Granted if your are sitting on 64gb of RAM your swap file will be huge, just kind of how hibernation works.
With how cheap fast storage got this isn’t really a concern. If you are fin with opening everything you need again every-time, good for you. If not hibernation is pretty amazing, especially for window hoarders like me XD.
Confirming that this guide works very well. Simple or not, it depends on your context, but well worth it ! So much better for battery life, from finishing the day, until the next working morning, if you want to keep your windows and apps as they are. Also when on the go, between transportation and time when you can use your laptop, etc.
FrameWork 13, 12th Gen Intel, swap partition, Ubuntu 22.04.
What this does, as most KDE applications and Libreoffice are session-aware, they will all start and load the files they saved prior shutting down.
This is IMHO the clean way of doing things.
It is the clean way to do it and if all the applications you use support it good for you. I’ll just stick to the more brute force method that just works on everything.
Followed the guide, but needed to increase the swapfile size to 1.5x RAM size (16GB RAM => 24GB Swap) for it to actually work. For the initramfs I needed to set /swap.img and resume=0 since all else threw errors.
Delighted to finally have this working and be rid of anything holding me back from using my Ubuntu 24.04 install like I used Windows 11 on my Framework 13 Performance Machine.
I dumped windows 25 years ago actually.
And, back in the old days where booting up was an issue, I did so too.
Nowadays, I just make sure session are saved and shut down. Faster :}
Hibernation writes data to a disk partition.
It can also be the swap file - problem is when the swap-file is on an encrypted device it won’t work here (at least last time I tried).
Note that the swap-partition needs to be of the same size (or a little larger) than the RAM you have on you device. Then, and I’m sorry I haven’t tested it in a loooong time, I don’t think you can encrypt the swap partition.
Swapfile on encrypted drive has been working quite well for a while (even with btrfs).
It doesn’t, the hibernate image gets compressed so you can get away with less (and will just fail to hibernate if it can’t fit), what you say is good practice though and storage is still much cheaper than ram XD.
You can but it’s a pain, which is why working encrypted swapfile hibernate is so nice.
I recommend against unencrypted hibernate as that writes very sensitive information to disk, especially in a portable device that may get stolen.
@Adrian_Joachim Thanks for the updates. I’ll have to update my data now
Even though SWAP was nice to have, I would recommend against it now.
And, as Linux is so fast booting, I wouldn’t hibernate anymore. Well, at least, that’s what I do.