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

I installed Ubuntu 11.10 using the alternative CD and all installed well. For security reasons, I want to be able to wipe the swap of this machine on a regular basis.

I installed secure-delete tools. Now I want to use sswap. But to do so, I need to disable my swap.

How to I go about doing this, and are there any other tips on how to achieve the wiping of the machine's swap of a full encrypted harddisk.

share|improve this question

If you don't mind not being able to hibernate then you can just set up encrypted swap and never have to worry about the contents of your swap partition again. Your swap will be encrypted with a key that is randomly generated key on every boot. The key is only held in RAM. Once the power goes, your swap partition will effectively have random garbage that nobody (including you) will be able to decrypt.

The easiest way to enable it is to do:

sudo ecryptfs-setup-swap

See the man page for a little more detail. It is part of the ecryptfs-utils package.

share|improve this answer

Don't you trust the encryption, or why do you want to wipe it?

sudo swapoff 
sudo swapon 

can be used to stop and restart swapping.

You could alternatively boot from a live-CD and use dd to wipe the drive:

sudo dd if=/dev/null of=/dev/YOURSWAPPARTITION

but be careful! Don't forget the partitionnumber, or your whole disc content is lost.

share|improve this answer
It's just for extra measure. I might try the live CD way. How would I go about mounting the encrypted filesystem from the live CD, so that I can both use sswap, and that sswap can have access to the swap partition? – mloman Dec 21 '11 at 17:59
First I have to admit, that I don't know sswap. I thought it is a typo, and you meant swap. I don't know how sswap works - swapon/swapoff work with normal swap. For using dd, you wouldn't mount the partition, if it is a whole partition. – user unknown Dec 21 '11 at 19:53

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.