Do you need an encrypted swap file if the Linux / (root) filesystem is encrypted itself?

I have my / (root) filesystem already encrypted with LUKS on Ubuntu Linux. But, I’m running out of RAM so I need to set more swap space as default is 512MB only. I’m going to create /swap file as “How to create swap space file on Ubuntu Linux - nixCraft” as explained. So my question is - do I need an encrypted swap file if the Linux / (root) filesystem is encrypted itself? It is not clear for me. Can anyone confirm it?

That is correct. There is no need to encrypt the /swapfile if it is already on your encrypted / file system.

1 Like