Comment by mdspan

2 days ago

Swap files are also much easier to set up than partitions if you're using full disk encryption.

Swap files are very fragile if you are using hibernation. For FDE I prefer LVM-over-LUKS and a dedicate partition

  • MacOS seems to have no problem with hibernating and it and its predecessor NeXT have been using swap files for over 30 years.

    • MacOS has no problem with hibernation because hardware and software are designed together: it uses TPM to manage swap encryption. I assume "BIOS" is also optimized to enable fast boot on sleep.

      Linux can work with TPM but it's never as smooth. (Unless I guess you make it custom for your specific setup.)

      2 replies →

How so? It's a one time setup procedure of only a few steps to create a tiny "protective" ext4 (or whatever) partition at the front. Thereafter you configure crypttab to mount the partition via UUID with an offset and key. If you don't need to hibernate you can read the key from /dev/urandom.