Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Selecting the encryption option at install time to encrypt the home partition. Does this enable encryption of the swap partition or is the swap partition unencrypted. If the swap partition is unencrypted, how do I encrypt the swap and home partitions.

share|improve this question
up vote 15 down vote accepted

By default, selecting the “Encrypt my home directory” option at install time will encrypt your swap space¹ as well - at least in Ubuntu 10.04 and newer (I don't know when this was implemented, so it could well be earlier).

Technically, it uses the ecryptfs-setup-swap program to do the swap encryption. You can use this tool if you want to encrypt your swap space post-install.

¹: This applies to both swap partitions and any swap files you may have set up.

share|improve this answer
how can i check via commandline if the swap-partition is encrypted? – NES Dec 14 '10 at 18:36

No, data written to the swap partition is done so in cleartext. If you're looking to encrypt your swap partition, then you may find dm-crypt useful. This article talks about applying dm-crypt to the swap area.

share|improve this answer
So encrypting home directory with ecryptfs during Ubuntu installation encrypt also swap partition or not? – neuromancer Nov 9 '10 at 20:00

No, only the /home partition is encrypted. If you want more, you should use LUKS. See also Ubuntu help on encrypted fileystems.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.