Comment 17 for bug 1310058

ryokenau (ryokenau) wrote :

I followed through all the comments, but I've still run into problems after rebooting.

Comment #3 by syscon-hh <> and Albert's detailed instructions <> have been extremely helpful.

After this process is completed (as explained by Albert)...

"Then you can convert your unencrypted swap into an encrypted one, using sudo ecryptfs-setup-swap. That will now work fine, because you have patched the file to include "offset=8" in the /etc/crypttab file.
Again, use swapon -s to verify that the swap is enabled; but now it should display /dev/mapper/cryptswap1 as device."

...swap is not activated after a reboot. I confirmed that the latest changes to /etc/fstab and /etc/crypttab made by ecryptfs-setup-swap have remained intact.

So I tried manually enabling swap:

$ sudo swapon -a -v

Which resulted in the following error:

read swap header failed: Invalid argument

So I tried doing this:

$ sudo mkswap /dev/mapper/cryptswap1
$ sudo swapon -a -v

And swap was up and running again!

But does swap work after rebooting? It sure does, albeit with the following errors in dmesg:

device-mapper: ioctl: Unable to change name on mapped device cryptswap1_unformatted to one that already exists: cryptswap1

The only hint I can find so far is in /var/log/upstart/cryptdisks.log:

* cryptswap1 (starting)...
Device cryptswap1_unformatted already exists.

Any suggestions on what's happening here?