Is it necessary to encrypt a swap * file * if it will reside on an encrypted root filesytem

encryptionswap

I'm running Linux on my Laptop and wish to protect my data in case the machine is lost or stolen.

I've configured an encrypted ArchLinux environment and have everything working the way that I want. Now I wish to add suspend to disk functionality, which necessitates swap space. If I allocate swap space as a file on the root filesystem (which is already encrypted), does that swap file still need to be encrypted? Please explain why or why not.

Best Answer

If the root filesystem is encrypted, all files written to the filesystem, whether they be plain text files or swap files will all be encrypted.

Related Question