If I installed Ubuntu on an encrypted ext4 partition, I normally have a /swapfile
. Now I would expect that the swapped memory is also encrypted by default. However, the man-page of swapon
says:
The swap file implementation in the kernel expects to be able to write to the file directly, without the assistance of the filesystem.
Now it remains ambiguous what "directly" means and, in particular, whether the encryption layer above the ext4 is considered a "filesystem" in that sense. A priori, I cannot exclude the possibility that the kernel first simply obtains the location of the swapfile on the disk and then directly writes to the disk, without using the encryption layer, such that memory data ends up being on the disk unencrypted.
Is my suspicion true (for which Linux versions)? If not, please provide a source, which directly addresses this question; not just one of many instructions on the Internet how to setup a swap file on an encrypted partition. Thank you!
lsblk -f
only sayscrypto 2
.