Since swapfile shouldn’t be in a snapshot, and I want my system encrypted therefore I am asking if it could be possible to make efi partition big enough to include swapfile inside it?
I can’t find documentation for this process, so would it require some extra steps to make it work?
Although swapfiles shouldn’t be in snapshots (or otherwise Copy-On-Write), that doesn’t mean you can’t have them in btrfs. You can create a non-COW file in a separate btrfs subvolume that you don’t enable automatic snapshots for and use that for swap. btrfs-progs even has a
btrfs filesystem mkswapfile
convenience command for allocating a NOCOW file suitable for swap use, though you still need to make sure to put it in a subvolume that you don’t make snapshots for.You probably don’t want to put swap in an unencrypted partition if you’re encrypting your root filesystem. Swap is liable to write sensitive data to disk, especially if you use hibernate.