So if I read the LVMonLUKS section of the Wiki correctly, system hibernation power management won’t work without a swap partition. Before I venture into the unknown, I’d just like to ask: Will a swap partition that’s encrypted enable hibernation? Can I set up an encrypted swap partition post-installation?
That’s a very old wiki article. It should still work but nowadays I would recommend a swap file instead of a dedicated partition.
If I may ask, why do you want to use logical volumes (LVM) in your setup? There may be easier ways to achieve your goals.
To add a swapfile after installation:
https://discovery.endeavouros.com/storage-and-partitions/adding-swap-after-installation/2021/03/
Hibernation does not require swap partition. Swap file can be set up post-install.
Creating swap file is described in
https://wiki.archlinux.org/title/swap#Swap_file_creation
https://discovery.endeavouros.com/storage-and-partitions/adding-swap-after-installation/2021/03/
For example I have 2G swapfile and zram matched to my total RAM with zram having higher priority. Most likely other could be removed and size tinkered, but haven’t really bothered as this works. I did installation with no swap configured.
Not really interested in LVM, just LUKS. According to this ArchWiki article
“Depending on requirements, different methods may be used to encrypt the swap partition which are described in the following. A setup where the swap encryption is re-initialised on reboot (with a new encryption) provides higher data protection, because it avoids sensitive file fragments which may have been swapped out a long time ago without being overwritten. However, re-encrypting swap also forbids using a suspend-to-disk feature generally.”
Yes, such a setup is possible. It is described further down in the article you linked:
https://wiki.archlinux.org/title/dm-crypt/Swap_encryption#With_suspend-to-disk_support
Yes. Setting up an encrypted swap partition that supports hibernation is described here:
https://wiki.archlinux.org/title/dm-crypt/Swap_encryption#Using_a_swap_partition
The simplest way may be to set up an encrypted swap file, so you don’t need to cut in a new partition.
https://wiki.archlinux.org/title/dm-crypt/Swap_encryption#Using_a_swap_file
In that case I would recommend setting up a new system with the standard EOS calamares installer. Just choose btrfs, encryption and a swapfile in the installer gui.
If you need hibernation you may have to enlarge your swapfile after the initial install. But this is an easy process we can help with.
I suppose a re-install would be an expedient way. Would the swap partition be able to be encrypted? Or is encryption completely out of the question, in order to enable hibernation?
Reinstallation is not necessary, and certainly would not be more expedient than setting up an encrypted swap file.
It is not out of the question in any sense. Not only is hibernating to an encrypted swap space a supported feature, it is also a well-documented feature. If you have a chance, read through the links I posted above and you will see what I mean.
As mentioned before: a swap file is sufficient. And if the swapfile is located on the LUKS encrypted root partition it will be encrypted too. And this works fine. This is actually the setup I am using on my laptop.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.