Archlinux swap and hibernation

#ops

Context

Modern computers have 16 to 32Gb of available RAM, and any browser will eat all of it if allowed.

This is a major issue when triggering hibernation, since all RAM must go into swap partition, most likely smaller than mounted RAM. This means on most modern computers hibernation can fail really often.

It’s an issue because hibernation is the main thing that I use when leaving my computer. Since it’s booting in 30s thanks to an SSD disk, there is really no need to use electricity for nothing.

But,

I don’t really want to give up comfort, so I want all my open apps and config bits ready when I come back.

Solution

This is where we can use swap file to allow easy extension of swap capabilities and at-rest encryption.

Simple, problem solved.

Pleasant hibernation to all.